diff --git a/src/ensembl/utils/plugin.py b/src/ensembl/utils/plugin.py index c286fd2..e6ffacb 100644 --- a/src/ensembl/utils/plugin.py +++ b/src/ensembl/utils/plugin.py @@ -199,7 +199,7 @@ def test_method(..., test_dbs: dict[str, UnitTestDB], ...): name = argument.get("name", None) try: key = name if name else src.name - except AttributeError: - raise TypeError("Expected at least 'src' or 'name' argument defined") + except AttributeError as exc: + raise TypeError("Expected at least 'src' or 'name' argument defined") from exc databases[key] = db_factory(src=src, name=name, metadata=argument.get("metadata")) return databases diff --git a/tests/plugin/test_plugin.py b/tests/plugin/test_plugin.py index 8ac4985..24cf446 100644 --- a/tests/plugin/test_plugin.py +++ b/tests/plugin/test_plugin.py @@ -139,5 +139,6 @@ def test_db_factory( indirect=["test_dbs"], ) def test_test_dbs(test_dbs: dict[str, UnitTestDB], expected_db_name: str) -> None: + """Tests the `test_dbs` fixture.""" assert expected_db_name in test_dbs assert test_dbs[expected_db_name].dbc is not None