Skip to content

Commit 8fa952b

Browse files
committed
Update tests
1 parent f49067e commit 8fa952b

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

Lib/test/test_sys.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -719,6 +719,8 @@ def test_attributes(self):
719719
self.assertIn(sys.float_repr_style, ('short', 'legacy'))
720720
if not sys.platform.startswith('win'):
721721
self.assertIsInstance(sys.abiflags, str)
722+
else:
723+
self.assertFalse(hasattr(sys, 'abiflags'))
722724

723725
def test_thread_info(self):
724726
info = sys.thread_info

Lib/test/test_sysconfig.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -615,13 +615,17 @@ def test_abiflags(self):
615615
abiflags = sysconfig.get_config_var('abiflags')
616616
ABIFLAGS = sysconfig.get_config_var('ABIFLAGS')
617617

618+
self.assertIsInstance(abiflags, str)
619+
self.assertIsInstance(ABIFLAGS, str)
618620
self.assertIn(abiflags, ABIFLAGS)
621+
if ABIFLAGS:
622+
self.assertTrue(ABIFLAGS.isalpha(), ABIFLAGS)
619623

620624
if os.name == 'nt':
621625
self.assertEqual(abiflags, '')
622626

623627
if support.Py_DEBUG:
624-
self.assertIn('d', ABIFLAGS)
628+
self.assertEndsWith(ABIFLAGS, 'd')
625629
else:
626630
self.assertNotIn('d', ABIFLAGS)
627631
if support.Py_GIL_DISABLED:

0 commit comments

Comments
 (0)