Skip to content

Commit 3be84b3

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 6c86232 commit 3be84b3

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

src/_pytest/unittest.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -481,9 +481,7 @@ def pytest_runtest_makereport(item: Item, call: CallInfo[None]) -> None:
481481
unittest = sys.modules.get("unittest")
482482
if unittest and call.excinfo and isinstance(call.excinfo.value, unittest.SkipTest):
483483
excinfo = call.excinfo
484-
call2 = CallInfo[None].from_call(
485-
lambda: skip(str(excinfo.value)), call.when
486-
)
484+
call2 = CallInfo[None].from_call(lambda: skip(str(excinfo.value)), call.when)
487485
call.excinfo = call2.excinfo
488486

489487

testing/test_unittest.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1093,24 +1093,25 @@ def test_two(self):
10931093
result = pytester.runpytest("-s")
10941094
result.assert_outcomes(passed=2)
10951095

1096-
def test_skip_setup_class(pytester:Pytester)->None:
1096+
1097+
def test_skip_setup_class(pytester: Pytester) -> None:
10971098
"""
10981099
Skipping tests in a class by raising unittest.SkipTest in `setUpClass` (#13985).
10991100
"""
11001101
pytester.makepyfile(
11011102
"""
11021103
import unittest
1103-
1104+
11041105
class Test(unittest.TestCase):
1105-
1106+
11061107
@classmethod
11071108
def setUpClass(cls):
11081109
raise unittest.SkipTest('Skipping setupclass')
1109-
1110-
def test_foo(self):
1110+
1111+
def test_foo(self):
11111112
assert False
1112-
1113-
def test_bar(self):
1113+
1114+
def test_bar(self):
11141115
assert False
11151116
"""
11161117
)
@@ -1130,7 +1131,7 @@ def test_unittest_skip_function(pytester: Pytester) -> None:
11301131
"""
11311132
import unittest
11321133
1133-
def test_foo():
1134+
def test_foo():
11341135
raise unittest.SkipTest('Skipping test_foo')
11351136
"""
11361137
)

0 commit comments

Comments
 (0)