diff --git a/Lib/test/test_sys.py b/Lib/test/test_sys.py index 599f09be35f..d2978702b63 100644 --- a/Lib/test/test_sys.py +++ b/Lib/test/test_sys.py @@ -5,6 +5,11 @@ import struct import subprocess import textwrap +# count the number of test runs, used to create unique +# strings to intern in test_intern() +numruns = 0 + + class SysModuleTest(unittest.TestCase): def setUp(self): @@ -383,8 +388,10 @@ class SysModuleTest(unittest.TestCase): self.assertEqual(sys.__stdout__.encoding, sys.__stderr__.encoding) def test_intern(self): + global numruns + numruns += 1 self.assertRaises(TypeError, sys.intern) - s = "never interned before" + s = "never interned before" + str(numruns) self.assertTrue(sys.intern(s) is s) s2 = s.swapcase().swapcase() self.assertTrue(sys.intern(s2) is s)