summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Garcia Moreno <daniel.garcia@suse.com>2024-02-09 11:49:08 +0100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2024-02-10 17:08:48 +0100
commit86d8034972db5014769cdd4832125067f31b3e8b (patch)
tree53da68f24a695288beb525f370a4228f3dccbbb9
parentcb173bb088e32df3d9ee8bee3c579d88ea713e8f (diff)
[4.2.x] 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 https://github.com/python/cpython/commit/0a737639dcd3b7181250f5d56694b192eaddeef0 Backport of bc8471f0aac8f0c215b9471b594d159783bac19b from main
-rw-r--r--tests/test_utils/tests.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/test_utils/tests.py b/tests/test_utils/tests.py
index b81e6b6c94..a440e7d962 100644
--- a/tests/test_utils/tests.py
+++ b/tests/test_utils/tests.py
@@ -183,9 +183,11 @@ class SkippingClassTestCase(TestCase):
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__")