tenseleyflow/sway / b76065a

Browse files

tests: ruff N818/PT018 fixups on the F06 test additions

Authored by mfwolffe <wolffemf@dukes.jmu.edu>
SHA
b76065aaa855697480bd3fc8359227f6b6af5dad
Parents
c078e25
Tree
b94efa4

2 changed files

StatusFile+-
M tests/integration/test_dlm_api_compat.py 4 1
M tests/unit/test_dlm_bridge.py 3 3
tests/integration/test_dlm_api_compat.pymodified
@@ -80,7 +80,10 @@ def test_base_resolves_with_hf_id(key: str) -> None:
8080
         f"without .hf_id — public-surface drift. Visible attrs: "
8181
         f"{sorted(a for a in dir(spec) if not a.startswith('_'))[:8]!r}"
8282
     )
83
-    assert isinstance(spec.hf_id, str) and "/" in spec.hf_id, (
83
+    assert isinstance(spec.hf_id, str), (
84
+        f"dlm.base_models.resolve({key!r}).hf_id = {spec.hf_id!r} — expected a string."
85
+    )
86
+    assert "/" in spec.hf_id, (
8487
         f"dlm.base_models.resolve({key!r}).hf_id = {spec.hf_id!r} — "
8588
         "not a plausible HuggingFace 'org/name' id."
8689
     )
tests/unit/test_dlm_bridge.pymodified
@@ -245,11 +245,11 @@ def test_resolve_raises_dlm_compat_error_on_resolve_exception(
245245
         _Frontmatter(), sections=()
246246
     )
247247
 
248
-    class _RegistryDrift(RuntimeError):
248
+    class _RegistryDriftError(RuntimeError):
249249
         pass
250250
 
251251
     def _raise(_k: str) -> object:
252
-        raise _RegistryDrift("unknown base key after rename")
252
+        raise _RegistryDriftError("unknown base key after rename")
253253
 
254254
     dlm_base = types.ModuleType("dlm.base_models")
255255
     dlm_base.resolve = _raise  # type: ignore[attr-defined]
@@ -265,7 +265,7 @@ def test_resolve_raises_dlm_compat_error_on_resolve_exception(
265265
     from dlm_sway.core.errors import DlmCompatError
266266
     from dlm_sway.integrations.dlm.resolver import resolve_dlm
267267
 
268
-    with pytest.raises(DlmCompatError, match="_RegistryDrift"):
268
+    with pytest.raises(DlmCompatError, match="_RegistryDriftError"):
269269
         resolve_dlm(dlm_file)
270270
 
271271