summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_builtin.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2009-10-27 22:57:25 (GMT)
committerGeorg Brandl <georg@python.org>2009-10-27 22:57:25 (GMT)
commit23016276b6a977c3620aaa1e7ff7d0e3b2a659d4 (patch)
tree08ad079ff92b4055c9c5b53a1ed85fa5fc0198a5 /Lib/test/test_builtin.py
parenta8507d59db7bd9ee4a2b8dda95e27212832fbbb2 (diff)
downloadcpython-23016276b6a977c3620aaa1e7ff7d0e3b2a659d4.zip
cpython-23016276b6a977c3620aaa1e7ff7d0e3b2a659d4.tar.gz
cpython-23016276b6a977c3620aaa1e7ff7d0e3b2a659d4.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. ........
Diffstat (limited to 'Lib/test/test_builtin.py')
-rw-r--r--Lib/test/test_builtin.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/test/test_builtin.py b/Lib/test/test_builtin.py
index 910658d..d8e6041 100644
--- a/Lib/test/test_builtin.py
+++ b/Lib/test/test_builtin.py
@@ -13,6 +13,7 @@ warnings.filterwarnings("ignore", "integer argument expected",
# count the number of test runs.
# used to skip running test_execfile() multiple times
+# and to create unique strings to intern in test_intern()
numruns = 0
class Squares:
@@ -646,7 +647,9 @@ class BuiltinTest(unittest.TestCase):
def test_intern(self):
self.assertRaises(TypeError, intern)
- s = "never interned before"
+ # This fails if the test is run twice with a constant string,
+ # therefore append the run counter
+ s = "never interned before " + str(numruns)
self.assert_(intern(s) is s)
s2 = s.swapcase().swapcase()
self.assert_(intern(s2) is s)