summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Lib/test/test_sys.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/Lib/test/test_sys.py b/Lib/test/test_sys.py
index cac90f4..1678397 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):
@@ -379,8 +384,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)