mirror of
https://github.com/django/django.git
synced 2025-01-09 09:55:57 +00:00
[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. Refs0a737639dc
Backport ofbc8471f0aa
from main
This commit is contained in:
parent
761e913191
commit
1ba5afa0f2
@ -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__")
|
||||
|
Loading…
Reference in New Issue
Block a user