summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2009-10-27 23:00:28 (GMT)
committerGeorg Brandl <georg@python.org>2009-10-27 23:00:28 (GMT)
commit035265540ad9619b4427c6a650d4d7664e5c206d (patch)
tree05e8b715e7f7ed8473194e22ce446ed90168d9bc
parenta9023be8734242c14c6e9079b180d255fff94841 (diff)
downloadcpython-035265540ad9619b4427c6a650d4d7664e5c206d.zip
cpython-035265540ad9619b4427c6a650d4d7664e5c206d.tar.gz
cpython-035265540ad9619b4427c6a650d4d7664e5c206d.tar.bz2
Merged revisions 75887 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r75887 | georg.brandl | 2009-10-27 23:56:09 +0100 (Di, 27 Okt 2009) | 1 line Make sure every run of test_intern() interns a new string, otherwise that test fails e.g. when some other test in test_builtin fails and it is rerun in verbose 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 599f09b..d297870 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)