From 35ede04ebab107d971fdbc637cbbfb90c942d240 Mon Sep 17 00:00:00 2001 From: Anusha Shekhar Date: Wed, 13 Dec 2023 22:57:06 -0500 Subject: [PATCH] Codecov --- testing/test_hookcaller.py | 12 +++++++----- testing/test_tracer.py | 3 --- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/testing/test_hookcaller.py b/testing/test_hookcaller.py index b21902e6..c5788a8b 100644 --- a/testing/test_hookcaller.py +++ b/testing/test_hookcaller.py @@ -410,7 +410,8 @@ def hello(self, arg: object) -> None: pm.add_hookspecs(Api) - # make sure a bad signature still raises an error when using specname + """make sure a bad signature still raises an error when using specname""" + class Plugin: @hookimpl(specname="hello") def foo(self, arg: int, too, many, args) -> int: @@ -419,8 +420,9 @@ def foo(self, arg: int, too, many, args) -> int: with pytest.raises(PluginValidationError): pm.register(Plugin()) - # make sure check_pending still fails if specname doesn't have a - # corresponding spec. EVEN if the function name matches one. + """make sure check_pending still fails if specname doesn't have a + corresponding spec. EVEN if the function name matches one.""" + class Plugin2: @hookimpl(specname="bar") def hello(self, arg: int) -> int: @@ -456,9 +458,9 @@ def test_hookcaller_repr_with_saferepr_failure( ) -> None: @addmeth() def he_method2() -> None: - # Intentional error to make the repr fail + """Intentional error to make the repr fail""" raise ValueError("Intentional error in he_method2") - # Verify that HookCaller.repr with saferepr still works despite the error + """Verify that HookCaller.repr with saferepr still works despite the error""" expected_repr = f"" assert repr(hc) == expected_repr diff --git a/testing/test_tracer.py b/testing/test_tracer.py index 46658486..2fdc2eac 100644 --- a/testing/test_tracer.py +++ b/testing/test_tracer.py @@ -243,9 +243,6 @@ def test_saferepr_broken_getattribute(): """ class SomeClass: - def __getattribute__(self, attr): - raise RuntimeError - def __repr__(self): raise RuntimeError