Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Secrus committed Jul 26, 2022
1 parent 10e2740 commit b094be0
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions tests/test_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

import inspect

from types import FrameType

from crashtest.frame import Frame
from tests.helpers import nested_exception
from tests.helpers import simple_exception
Expand All @@ -19,15 +17,15 @@ def test_frame() -> None:
same_frame = Frame(frame_info)
assert frame_info.frame == frame.frame

assert frame.lineno == 11
assert frame.lineno == 14
assert frame.filename == __file__
assert frame.function == "test_frame"
assert frame.line == " simple_exception()\n"

with open(__file__) as f:
assert f.read() == frame.file_content

assert repr(frame) == f"<Frame {__file__}, test_frame, 11>"
assert repr(frame) == f"<Frame {__file__}, test_frame, 14>"

try:
nested_exception()
Expand All @@ -44,7 +42,7 @@ def test_frame() -> None:

def test_frame_with_no_context_should_return_empty_line() -> None:
frame = Frame(
inspect.FrameInfo(FrameType(), "filename.py", 123, "function", None, 3)
inspect.FrameInfo(None, "filename.py", 123, "function", None, 3) # type: ignore
)

assert frame.line == ""

0 comments on commit b094be0

Please sign in to comment.