Skip to content

Commit 20b7aac

Browse files
authored
Refs #34900, Refs #34118 -- Updated assertion in test_skip_class_unless_db_feature() test on Python 3.12.1+.
Python 3.12.1+ no longer includes skipped tests in the number of running tests. Check out: python/cpython#110890 (comment) python/cpython#106588
1 parent 3b4a571 commit 20b7aac

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tests/test_utils/tests.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import os
2+
import sys
23
import unittest
34
import warnings
45
from io import StringIO
@@ -180,7 +181,9 @@ class SkippedTestsSubclass(SkippedTests):
180181
except unittest.SkipTest:
181182
self.fail("SkipTest should not be raised here.")
182183
result = unittest.TextTestRunner(stream=StringIO()).run(test_suite)
183-
self.assertEqual(result.testsRun, 3)
184+
# PY312: Python 3.12.1+ no longer includes skipped tests in the number
185+
# of running tests.
186+
self.assertEqual(result.testsRun, 1 if sys.version_info >= (3, 12, 1) else 3)
184187
self.assertEqual(len(result.skipped), 2)
185188
self.assertEqual(result.skipped[0][1], "Database has feature(s) __class__")
186189
self.assertEqual(result.skipped[1][1], "Database has feature(s) __class__")

0 commit comments

Comments
 (0)