Skip to content

Commit 962d209

Browse files
committed
adjust test for sys.flags to match limit
1 parent b3816b5 commit 962d209

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Lib/test/test_sys.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -868,13 +868,14 @@ def test_sys_flags(self):
868868
"ignore_environment", "verbose", "bytes_warning", "quiet",
869869
"hash_randomization", "isolated", "dev_mode", "utf8_mode",
870870
"warn_default_encoding", "safe_path", "int_max_str_digits",
871-
"lazy_imports")
871+
"lazy_imports", "traceback_timestamps")
872872
for attr in attrs:
873873
self.assertHasAttr(sys.flags, attr)
874874
attr_type = bool if attr in ("dev_mode", "safe_path") else int
875+
attr_type = str if attr == "traceback_timestamps" else attr_type
875876
self.assertEqual(type(getattr(sys.flags, attr)), attr_type, attr)
876877
self.assertTrue(repr(sys.flags))
877-
self.assertEqual(len(sys.flags), len(attrs))
878+
self.assertEqual(len(sys.flags), 18) # Do not increase, see GH-122575
878879

879880
self.assertIn(sys.flags.utf8_mode, {0, 1, 2})
880881

@@ -1920,9 +1921,10 @@ def test_pythontypes(self):
19201921
# - 'gil'
19211922
# - 'thread_inherit_context'
19221923
# - 'context_aware_warnings'
1924+
# - 'lazy_imports'
19231925
# - 'traceback_timestamps'
19241926
# It will not be necessary once GH-122575 is fixed.
1925-
non_sequence_fields = 4
1927+
non_sequence_fields = 5
19261928
check(sys.flags, vsize('') + self.P + self.P * (non_sequence_fields + len(sys.flags)))
19271929

19281930
def test_asyncgen_hooks(self):

0 commit comments

Comments
 (0)