Skip to content

Commit

Permalink
Codecov
Browse files Browse the repository at this point in the history
  • Loading branch information
Anusha Shekhar authored and Anusha Shekhar committed Dec 14, 2023
1 parent cb4bb02 commit 35ede04
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
12 changes: 7 additions & 5 deletions testing/test_hookcaller.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down Expand Up @@ -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")

Check warning on line 462 in testing/test_hookcaller.py

View check run for this annotation

Codecov / codecov/patch

testing/test_hookcaller.py#L462

Added line #L462 was not covered by tests

# 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"<HookCaller {saferepr(hc.name)}>"
assert repr(hc) == expected_repr
3 changes: 0 additions & 3 deletions testing/test_tracer.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,6 @@ def test_saferepr_broken_getattribute():
"""

class SomeClass:
def __getattribute__(self, attr):
raise RuntimeError

def __repr__(self):
raise RuntimeError

Expand Down

0 comments on commit 35ede04

Please sign in to comment.