Skip to content

Commit fe61e01

Browse files
committed
Python unittest skip messages on 3.12.2 and later
On Python 3.12.2 and later the message given when no tests are run was reverted to the pre-3.12.1 era. Sigh. Let's adapt the nrunner selftest to take that into consideration. Signed-off-by: Cleber Rosa <[email protected]>
1 parent c437878 commit fe61e01

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

selftests/unit/nrunner.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -338,18 +338,18 @@ def test_runner_python_unittest_skip(self):
338338
runner_klass = runnable.pick_runner_class()
339339
runner = runner_klass()
340340
results = [status for status in runner.run(runnable)]
341-
if sys.version_info < (3, 12, 1):
341+
if sys.version_info == (3, 12, 1):
342342
output1 = (
343343
b"----------------------------------------------------------------------\n"
344-
b"Ran 1 test in "
344+
b"Ran 0 tests in "
345345
)
346-
output2 = b"s\n\nOK (skipped=1)\n"
346+
output2 = b"\n\nNO TESTS RAN (skipped=1)\n"
347347
else:
348348
output1 = (
349349
b"----------------------------------------------------------------------\n"
350-
b"Ran 0 tests in "
350+
b"Ran 1 test in "
351351
)
352-
output2 = b"\n\nNO TESTS RAN (skipped=1)\n"
352+
output2 = b"s\n\nOK (skipped=1)\n"
353353
output = results[-2]
354354
result = results[-1]
355355
self.assertEqual(result["status"], "finished")

0 commit comments

Comments
 (0)