Skip to content

Commit

Permalink
fixup! fix: small tweaks to debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
nedbat committed Oct 3, 2023
1 parent 7240403 commit 86ae426
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions coverage/debug.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,9 @@ def short_stack(limit: Optional[int] = None, skip: int = 0) -> str:
"""
# Substrings in initial frames that we don't care about.
BORING_PRELUDE = [
"<string>", # pytest-xdist has string execution.
"/igor.py", # Our test runner.
"/site-packages/", # pytest etc getting to our tests.
"<string>", # pytest-xdist has string execution.
"{os.sep}igor.py", # Our test runner.
"{os.sep}site-packages{os.sep}", # pytest etc getting to our tests.
]

stack: Iterable[inspect.FrameInfo] = inspect.stack()[limit:skip:-1]
Expand Down
1 change: 1 addition & 0 deletions tests/test_debug.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ class ShortStackTest(CoverageTest):

def test_short_stack(self) -> None:
stack = f_one().splitlines()
print(stack)
assert len(stack) == 4
assert "test_short_stack" in stack[0]
assert "f_one" in stack[1]
Expand Down

0 comments on commit 86ae426

Please sign in to comment.