Skip to content

Commit

Permalink
fix: NoDebugging needs all the methods of DebugControl #1904
Browse files Browse the repository at this point in the history
  • Loading branch information
nedbat committed Jan 7, 2025
1 parent 4fa393a commit e4c7c3d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions coverage/debug.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,11 @@ def should(self, option: str) -> bool:
"""Should we write debug messages? Never."""
return False

@contextlib.contextmanager
def without_callers(self) -> Iterator[None]:
"""A dummy context manager to satisfy the api."""
yield

def write(self, msg: str, *, exc: BaseException | None = None) -> None:
"""This will never be called."""
raise AssertionError("NoDebugging.write should never be called.")
Expand Down

0 comments on commit e4c7c3d

Please sign in to comment.