ruff fixed formatting
Code Quality Pipeline / code-quality (pull_request) Failing after 15s
Test Python Package / test (pull_request) Failing after 10s

This commit is contained in:
Brian Bjarke Jensen
2025-09-14 20:09:33 +02:00
parent 0e47db238a
commit 2fa633a44f
3 changed files with 29 additions and 14 deletions
@@ -7,8 +7,10 @@ from python_repositories.interfaces.context_aware_interface import ContextAwareI
def test_instantiation_fails_when_enter_not_implemented() -> None:
"""Test that instantiation fails if __enter__ is not implemented."""
class Incomplete(ContextAwareInterface):
"""A class that does not implement __enter__."""
def __exit__(
self, exc_type: type | None, exc_val: object | None, exc_tb: object | None
) -> None:
@@ -20,8 +22,10 @@ def test_instantiation_fails_when_enter_not_implemented() -> None:
def test_instantiation_fails_when_exit_not_implemented() -> None:
"""Test that instantiation fails if __exit__ is not implemented."""
class Incomplete(ContextAwareInterface):
"""A class that does not implement __exit__."""
def __enter__(self) -> Incomplete:
return self
@@ -31,8 +35,10 @@ def test_instantiation_fails_when_exit_not_implemented() -> None:
def test_enter_raises_not_implemented_if_not_overwritten() -> None:
"""Test that __enter__ raises NotImplementedError if not implemented."""
class Incomplete(ContextAwareInterface):
"""A class that does not implement __enter__."""
def __enter__(self) -> Incomplete:
super().__enter__() # type: ignore
return self
@@ -49,8 +55,10 @@ def test_enter_raises_not_implemented_if_not_overwritten() -> None:
def test_exit_raises_not_implemented_if_not_overwritten() -> None:
"""Test that __exit__ raises NotImplementedError if not implemented."""
class Incomplete(ContextAwareInterface):
"""A class that does not implement __exit__."""
def __enter__(self) -> ContextAwareInterface:
return self