Skip to content

Commit

Permalink
Consistently use raw strings for line-matching regexes (#180)
Browse files Browse the repository at this point in the history
Fixes #176.
  • Loading branch information
musicinmybrain authored Dec 26, 2024
1 parent 2fa1a6f commit f7c4cd0
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions tests/test_subtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,19 +394,19 @@ def test_foo(self):
if sys.version_info < (3, 11):
result.stderr.re_match_lines(
[
"FAIL: test_foo \(__main__\.T\) \[custom message\] \(i=4\).*",
"FAIL: test_foo \(__main__\.T\) \[custom message\] \(i=9\).*",
"Ran 1 test in .*",
"FAILED \(failures=6, skipped=4\)",
r"FAIL: test_foo \(__main__\.T\) \[custom message\] \(i=4\).*",
r"FAIL: test_foo \(__main__\.T\) \[custom message\] \(i=9\).*",
r"Ran 1 test in .*",
r"FAILED \(failures=6, skipped=4\)",
]
)
else:
result.stderr.re_match_lines(
[
"FAIL: test_foo \(__main__\.T\.test_foo\) \[custom message\] \(i=4\).*",
"FAIL: test_foo \(__main__\.T\.test_foo\) \[custom message\] \(i=9\).*",
"Ran 1 test in .*",
"FAILED \(failures=6, skipped=4\)",
r"FAIL: test_foo \(__main__\.T\.test_foo\) \[custom message\] \(i=4\).*",
r"FAIL: test_foo \(__main__\.T\.test_foo\) \[custom message\] \(i=9\).*",
r"Ran 1 test in .*",
r"FAILED \(failures=6, skipped=4\)",
]
)
elif runner == "pytest-normal":
Expand All @@ -418,11 +418,11 @@ def test_foo(self):
r"test_skip_with_failure.py::T::test_foo \[custom message\] \(i=4\) SUBFAIL .*",
r"test_skip_with_failure.py::T::test_foo \[custom message\] \(i=9\) SUBFAIL .*",
"test_skip_with_failure.py::T::test_foo PASSED .*",
"[custom message] (i=0) SUBSKIP [1] test_skip_with_failure.py:5: skip subtest i=0",
"[custom message] (i=0) SUBSKIP [1] test_skip_with_failure.py:5: skip subtest i=3",
"[custom message] (i=4) SUBFAIL test_skip_with_failure.py::T::test_foo - AssertionError: assert 4 < 4",
"[custom message] (i=9) SUBFAIL test_skip_with_failure.py::T::test_foo - AssertionError: assert 9 < 4",
".* 6 failed, 1 passed, 4 skipped in .*",
r"[custom message] (i=0) SUBSKIP [1] test_skip_with_failure.py:5: skip subtest i=0",
r"[custom message] (i=0) SUBSKIP [1] test_skip_with_failure.py:5: skip subtest i=3",
r"[custom message] (i=4) SUBFAIL test_skip_with_failure.py::T::test_foo - AssertionError: assert 4 < 4",
r"[custom message] (i=9) SUBFAIL test_skip_with_failure.py::T::test_foo - AssertionError: assert 9 < 4",
r".* 6 failed, 1 passed, 4 skipped in .*",
]
)
else:
Expand Down Expand Up @@ -463,19 +463,19 @@ def test_foo(self):
if sys.version_info < (3, 11):
result.stderr.re_match_lines(
[
"FAIL: test_foo \(__main__\.T\) \[custom message\] \(i=4\).*",
"FAIL: test_foo \(__main__\.T\) \[custom message\] \(i=9\).*",
"Ran 1 test in .*",
"FAILED \(failures=6, skipped=5\)",
r"FAIL: test_foo \(__main__\.T\) \[custom message\] \(i=4\).*",
r"FAIL: test_foo \(__main__\.T\) \[custom message\] \(i=9\).*",
r"Ran 1 test in .*",
r"FAILED \(failures=6, skipped=5\)",
]
)
else:
result.stderr.re_match_lines(
[
"FAIL: test_foo \(__main__\.T\.test_foo\) \[custom message\] \(i=4\).*",
"FAIL: test_foo \(__main__\.T\.test_foo\) \[custom message\] \(i=9\).*",
"Ran 1 test in .*",
"FAILED \(failures=6, skipped=5\)",
r"FAIL: test_foo \(__main__\.T\.test_foo\) \[custom message\] \(i=4\).*",
r"FAIL: test_foo \(__main__\.T\.test_foo\) \[custom message\] \(i=9\).*",
r"Ran 1 test in .*",
r"FAILED \(failures=6, skipped=5\)",
]
)
elif runner == "pytest-normal":
Expand Down

0 comments on commit f7c4cd0

Please sign in to comment.