summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2010-02-06 23:18:00 (GMT)
committerGeorg Brandl <georg@python.org>2010-02-06 23:18:00 (GMT)
commitd10d8ee2a1f0e4fd01816b5717eb5cc92684fb37 (patch)
treeed83b8f0c3b8304b89f5d2c7cc079cf7ada875e2 /Lib/test
parent1a0ffe168af3e3e9ab692435ea1d3362329c5a2b (diff)
downloadcpython-d10d8ee2a1f0e4fd01816b5717eb5cc92684fb37.zip
cpython-d10d8ee2a1f0e4fd01816b5717eb5cc92684fb37.tar.gz
cpython-d10d8ee2a1f0e4fd01816b5717eb5cc92684fb37.tar.bz2
Fix various missing import/unbound name errors.
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_richcmp.py14
-rw-r--r--Lib/test/test_tempfile.py2
-rw-r--r--Lib/test/test_threaded_import.py1
-rw-r--r--Lib/test/test_zipimport.py4
4 files changed, 11 insertions, 10 deletions
diff --git a/Lib/test/test_richcmp.py b/Lib/test/test_richcmp.py
index ed0b497..cc174d8 100644
--- a/Lib/test/test_richcmp.py
+++ b/Lib/test/test_richcmp.py
@@ -192,13 +192,13 @@ class MiscTest(unittest.TestCase):
def test_misbehavin(self):
class Misb:
- def __lt__(self, other): return 0
- def __gt__(self, other): return 0
- def __eq__(self, other): return 0
- def __le__(self, other): raise TestFailed, "This shouldn't happen"
- def __ge__(self, other): raise TestFailed, "This shouldn't happen"
- def __ne__(self, other): raise TestFailed, "This shouldn't happen"
- def __cmp__(self, other): raise RuntimeError, "expected"
+ def __lt__(self_, other): return 0
+ def __gt__(self_, other): return 0
+ def __eq__(self_, other): return 0
+ def __le__(self_, other): self.fail("This shouldn't happen")
+ def __ge__(self_, other): self.fail("This shouldn't happen")
+ def __ne__(self_, other): self.fail("This shouldn't happen")
+ def __cmp__(self_, other): raise RuntimeError, "expected"
a = Misb()
b = Misb()
self.assertEqual(a<b, 0)
diff --git a/Lib/test/test_tempfile.py b/Lib/test/test_tempfile.py
index a358210..2b73f54 100644
--- a/Lib/test/test_tempfile.py
+++ b/Lib/test/test_tempfile.py
@@ -127,7 +127,7 @@ class test__RandomNameSequence(TC):
if i == 20:
break
except:
- failOnException("iteration")
+ self.failOnException("iteration")
test_classes.append(test__RandomNameSequence)
diff --git a/Lib/test/test_threaded_import.py b/Lib/test/test_threaded_import.py
index fdbd7b7..4b925c4 100644
--- a/Lib/test/test_threaded_import.py
+++ b/Lib/test/test_threaded_import.py
@@ -6,6 +6,7 @@
# randrange, and then Python hangs.
import thread
+import unittest
from test.test_support import verbose, TestFailed
critical_section = thread.allocate_lock()
diff --git a/Lib/test/test_zipimport.py b/Lib/test/test_zipimport.py
index fa11d20..60a1452 100644
--- a/Lib/test/test_zipimport.py
+++ b/Lib/test/test_zipimport.py
@@ -230,7 +230,7 @@ class UncompressedZipImportTestCase(ImportHooksBaseTestCase):
mod_path = packdir2 + TESTMOD
mod_name = module_path_to_dotted_name(mod_path)
- pkg = __import__(mod_name)
+ __import__(mod_name)
mod = sys.modules[mod_name]
self.assertEquals(zi.get_source(TESTPACK), None)
self.assertEquals(zi.get_source(mod_path), None)
@@ -274,7 +274,7 @@ class UncompressedZipImportTestCase(ImportHooksBaseTestCase):
mod_path = TESTPACK2 + os.sep + TESTMOD
mod_name = module_path_to_dotted_name(mod_path)
- pkg = __import__(mod_name)
+ __import__(mod_name)
mod = sys.modules[mod_name]
self.assertEquals(zi.get_source(TESTPACK2), None)
self.assertEquals(zi.get_source(mod_path), None)