summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2009-10-27 23:01:30 (GMT)
committerGeorg Brandl <georg@python.org>2009-10-27 23:01:30 (GMT)
commitaee3486b318d11c10520b533735d98ade48776a5 (patch)
treefc730e590275aeae2fca4ed9f7d4c1ea86e29a60 /Lib/test
parentee26c98cb3897e8c85047ccf6543e27115af9262 (diff)
downloadcpython-aee3486b318d11c10520b533735d98ade48776a5.zip
cpython-aee3486b318d11c10520b533735d98ade48776a5.tar.gz
cpython-aee3486b318d11c10520b533735d98ade48776a5.tar.bz2
Merged revisions 75889 via svnmerge from
svn+ssh://svn.python.org/python/branches/py3k ................ r75889 | georg.brandl | 2009-10-28 00:00:28 +0100 (Mi, 28 Okt 2009) | 9 lines 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')
-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)