diff options
author | Georg Brandl <georg@python.org> | 2009-08-13 08:51:18 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2009-08-13 08:51:18 (GMT) |
commit | ab91fdef1f1e556203a2eee98ba7d379e4790de9 (patch) | |
tree | 6f8f00dc18cc5f2801a675df277c2c595eb85ec8 /Lib/test/test_import.py | |
parent | ef82be368abdea8e8032500e7ecc3a22f5f07851 (diff) | |
download | cpython-ab91fdef1f1e556203a2eee98ba7d379e4790de9.zip cpython-ab91fdef1f1e556203a2eee98ba7d379e4790de9.tar.gz cpython-ab91fdef1f1e556203a2eee98ba7d379e4790de9.tar.bz2 |
Merged revisions 73715 via svnmerge from
svn+ssh://svn.python.org/python/branches/py3k
........
r73715 | benjamin.peterson | 2009-07-01 01:06:06 +0200 (Mi, 01 Jul 2009) | 1 line
convert old fail* assertions to assert*
........
Diffstat (limited to 'Lib/test/test_import.py')
-rw-r--r-- | Lib/test/test_import.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Lib/test/test_import.py b/Lib/test/test_import.py index 8196865..44e67c3 100644 --- a/Lib/test/test_import.py +++ b/Lib/test/test_import.py @@ -172,12 +172,12 @@ class ImportTest(unittest.TestCase): # import x.y.z binds x in the current namespace import test as x import test.support - self.assert_(x is test, x.__name__) - self.assert_(hasattr(test.support, "__file__")) + self.assertTrue(x is test, x.__name__) + self.assertTrue(hasattr(test.support, "__file__")) # import x.y.z as w binds z as w import test.support as y - self.assert_(y is test.support, y.__name__) + self.assertTrue(y is test.support, y.__name__) def test_import_initless_directory_warning(self): with warnings.catch_warnings(): @@ -195,7 +195,7 @@ class ImportTest(unittest.TestCase): sys.path.insert(0, os.curdir) try: mod = __import__(TESTFN) - self.assert_(TESTFN in sys.modules, "expected module in sys.modules") + self.assertTrue(TESTFN in sys.modules, "expected module in sys.modules") self.assertEquals(mod.a, 1, "module has wrong attribute values") self.assertEquals(mod.b, 2, "module has wrong attribute values") @@ -212,7 +212,7 @@ class ImportTest(unittest.TestCase): self.assertRaises(ZeroDivisionError, imp.reload, mod) # But we still expect the module to be in sys.modules. mod = sys.modules.get(TESTFN) - self.failIf(mod is None, "expected module to still be in sys.modules") + self.assertFalse(mod is None, "expected module to still be in sys.modules") # We should have replaced a w/ 10, but the old b value should # stick. @@ -234,12 +234,12 @@ class ImportTest(unittest.TestCase): sys.path.insert(0, os.curdir) try: mod = __import__(TESTFN) - self.failUnless(mod.__file__.endswith('.py')) + self.assertTrue(mod.__file__.endswith('.py')) os.remove(source) del sys.modules[TESTFN] mod = __import__(TESTFN) ext = mod.__file__[-4:] - self.failUnless(ext in ('.pyc', '.pyo'), ext) + self.assertTrue(ext in ('.pyc', '.pyo'), ext) finally: sys.path.pop(0) remove_files(TESTFN) |