Skip to content

Commit

Permalink
Fixed tests to work on Windows (#488)
Browse files Browse the repository at this point in the history
A few tests fail on a clean checkout on Windows due to formatting differences (CRLF newlines and \ in filenames). These should now pass on both Windows and Unix/Linux platforms.
  • Loading branch information
thetorpedodog authored Sep 21, 2024
1 parent 016f813 commit 171314b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
3 changes: 2 additions & 1 deletion tests/test_importhook.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,6 @@ def test_debug_instrumentation(monkeypatch, capsys):
monkeypatch.setattr("typeguard.config.debug_instrumentation", True)
import_dummymodule()
out, err = capsys.readouterr()
assert f"Source code of '{dummy_module_path}' after instrumentation:" in err
path_str = str(dummy_module_path)
assert f"Source code of {path_str!r} after instrumentation:" in err
assert "class DummyClass" in err
5 changes: 2 additions & 3 deletions tests/test_typechecked.py
Original file line number Diff line number Diff line change
Expand Up @@ -619,9 +619,8 @@ def foo(x: int) -> None:
)
assert process.returncode == expected_return_code
if process.returncode == 1:
assert process.stderr.endswith(
b'typeguard.TypeCheckError: argument "x" (str) is not an instance of '
b"int\n"
assert process.stderr.strip().endswith(
b'typeguard.TypeCheckError: argument "x" (str) is not an instance of int'
)


Expand Down

0 comments on commit 171314b

Please sign in to comment.