Refs #34900, Refs #34118 -- Updated assertion in test_skip_class_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
0a737639dc
This commit is contained in:
Daniel Garcia Moreno 2024-02-09 11:49:08 +01:00 committed by Mariusz Felisiak
parent b47bdb4cd9
commit bc8471f0aa
1 changed files with 5 additions and 3 deletions

View File

@ -184,9 +184,11 @@ class SkippingClassTestCase(TransactionTestCase):
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__")