diff options
| author | Daniel Garcia Moreno <daniel.garcia@suse.com> | 2024-02-09 11:49:08 +0100 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2024-02-10 17:08:07 +0100 |
| commit | 1ba5afa0f21f10843bb530b443687e07a511516a (patch) | |
| tree | 8cf9f31cdd46f7c04b78d7f7c2ea3dfe9a26b72a | |
| parent | 761e913191bf9c3705991c92d329a9f23d710b9f (diff) | |
[5.0.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.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/test_utils/tests.py b/tests/test_utils/tests.py index 963fa2fe0d..d8feda9423 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__") |
