Skip to content

Commit

Permalink
[4.2.x] Refs #34900, Refs #34118 -- Updated assertion in test_skip_cl…
Browse files Browse the repository at this point in the history
…ass_unless_db_feature() test on Python 3.12.2+.

Python 3.12.2 bring back the skipped tests in the number of running
tests. Refs
python/cpython@0a73763

Backport of bc8471f from main
  • Loading branch information
danigm authored and felixxm committed Feb 10, 2024
1 parent cb173bb commit 86d8034
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/test_utils/tests.py
Expand Up @@ -183,9 +183,11 @@ class SkippedTestsSubclass(SkippedTests):
except unittest.SkipTest:
self.fail("SkipTest should not be raised here.")
result = unittest.TextTestRunner(stream=StringIO()).run(test_suite)
# PY312: Python 3.12.1+ no longer includes skipped tests in the number
# of running tests.
self.assertEqual(result.testsRun, 1 if sys.version_info >= (3, 12, 1) else 3)
# PY312: Python 3.12.1 does not include skipped tests in the number of
# running tests.
self.assertEqual(
result.testsRun, 1 if sys.version_info[:3] == (3, 12, 1) else 3
)
self.assertEqual(len(result.skipped), 2)
self.assertEqual(result.skipped[0][1], "Database has feature(s) __class__")
self.assertEqual(result.skipped[1][1], "Database has feature(s) __class__")
Expand Down

0 comments on commit 86d8034

Please sign in to comment.