diff --git a/tests/test_utils/tests.py b/tests/test_utils/tests.py index 7df81650d5..bce060f7ef 100644 --- a/tests/test_utils/tests.py +++ b/tests/test_utils/tests.py @@ -1,4 +1,5 @@ import os +import sys import unittest import warnings from io import StringIO @@ -180,7 +181,9 @@ class SkippingClassTestCase(TestCase): except unittest.SkipTest: self.fail("SkipTest should not be raised here.") result = unittest.TextTestRunner(stream=StringIO()).run(test_suite) - self.assertEqual(result.testsRun, 3) + # 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) 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__")