Skip to content

Commit b116a0a

Browse files
committed
Fix tests to work on Windows.
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.
1 parent 016f813 commit b116a0a

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

tests/test_importhook.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,5 +64,6 @@ def test_debug_instrumentation(monkeypatch, capsys):
6464
monkeypatch.setattr("typeguard.config.debug_instrumentation", True)
6565
import_dummymodule()
6666
out, err = capsys.readouterr()
67-
assert f"Source code of '{dummy_module_path}' after instrumentation:" in err
67+
path_str = str(dummy_module_path)
68+
assert f"Source code of {path_str!r} after instrumentation:" in err
6869
assert "class DummyClass" in err

tests/test_typechecked.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -619,9 +619,8 @@ def foo(x: int) -> None:
619619
)
620620
assert process.returncode == expected_return_code
621621
if process.returncode == 1:
622-
assert process.stderr.endswith(
623-
b'typeguard.TypeCheckError: argument "x" (str) is not an instance of '
624-
b"int\n"
622+
assert process.stderr.strip().endswith(
623+
b'typeguard.TypeCheckError: argument "x" (str) is not an instance of int'
625624
)
626625

627626

0 commit comments

Comments
 (0)