Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Apr 26, 2024
1 parent 4e13a5f commit e209a3d
Showing 1 changed file with 29 additions and 21 deletions.
50 changes: 29 additions & 21 deletions testing/test_unittest.py
Expand Up @@ -1516,18 +1516,22 @@ def test(self):
pass
"""
)
result = pytester.runpytest('-s', testpath)
result = pytester.runpytest("-s", testpath)
result.assert_outcomes(passed=0, errors=1)
result.stderr.fnmatch_lines([
'class cleanup error (1 of 2):',
'Exception: fail 1',
'class cleanup error (2 of 2):',
'Exception: fail 2',
])
result.stdout.fnmatch_lines([
'* ERROR at setup of MyTestCase.test *',
'E * Exception: fail 0',
])
result.stderr.fnmatch_lines(
[
"class cleanup error (1 of 2):",
"Exception: fail 1",
"class cleanup error (2 of 2):",
"Exception: fail 2",
]
)
result.stdout.fnmatch_lines(
[
"* ERROR at setup of MyTestCase.test *",
"E * Exception: fail 0",
]
)


def test_class_cleanups_failure_in_teardown(pytester: Pytester) -> None:
Expand All @@ -1545,17 +1549,21 @@ def test(self):
pass
"""
)
result = pytester.runpytest('-s', testpath)
result = pytester.runpytest("-s", testpath)
result.assert_outcomes(passed=1, errors=1)
result.stderr.fnmatch_lines([
'class cleanup error (1 of 2):',
'Traceback *',
'Exception: fail 1',
])
result.stdout.fnmatch_lines([
'* ERROR at teardown of MyTestCase.test *',
'E * Exception: fail 2',
])
result.stderr.fnmatch_lines(
[
"class cleanup error (1 of 2):",
"Traceback *",
"Exception: fail 1",
]
)
result.stdout.fnmatch_lines(
[
"* ERROR at teardown of MyTestCase.test *",
"E * Exception: fail 2",
]
)


def test_traceback_pruning(pytester: Pytester) -> None:
Expand Down

0 comments on commit e209a3d

Please sign in to comment.