summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_runpy.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-07-11 12:20:59 (GMT)
committerGuido van Rossum <guido@python.org>2007-07-11 12:20:59 (GMT)
commite61fd5b5ed9d677da2f3349078d7f66f707199de (patch)
treee28a7630ed3c285eabc7631f4276a2b06e74682b /Lib/test/test_runpy.py
parentc9b9de17976a4832f505309b1096f9a7582c7be9 (diff)
downloadcpython-e61fd5b5ed9d677da2f3349078d7f66f707199de.zip
cpython-e61fd5b5ed9d677da2f3349078d7f66f707199de.tar.gz
cpython-e61fd5b5ed9d677da2f3349078d7f66f707199de.tar.bz2
Patch by Christian Heimes to change self.assert_(x == y) into
self.assertEqual(x, y). (Christian used self.failUnlessEqual(), but the double negative makes it hard to grok, so I changed it.)
Diffstat (limited to 'Lib/test/test_runpy.py')
-rw-r--r--Lib/test/test_runpy.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/test/test_runpy.py b/Lib/test/test_runpy.py
index e0fdabc..868662d 100644
--- a/Lib/test/test_runpy.py
+++ b/Lib/test/test_runpy.py
@@ -45,8 +45,8 @@ class RunModuleCodeTest(unittest.TestCase):
True)
self.failUnless("result" not in d1)
self.failUnless(d2["initial"] is initial)
- self.failUnless(d2["result"] == self.expected_result)
- self.failUnless(d2["nested"]["x"] == 1)
+ self.assertEqual(d2["result"], self.expected_result)
+ self.assertEqual(d2["nested"]["x"], 1)
self.failUnless(d2["__name__"] is name)
self.failUnless(d2["run_name"] is name)
self.failUnless(d2["__file__"] is file)
@@ -58,7 +58,7 @@ class RunModuleCodeTest(unittest.TestCase):
def test_run_module_code_defaults(self):
saved_argv0 = sys.argv[0]
d = _run_module_code(self.test_source)
- self.failUnless(d["result"] == self.expected_result)
+ self.assertEqual(d["result"], self.expected_result)
self.failUnless(d["__name__"] is None)
self.failUnless(d["__file__"] is None)
self.failUnless(d["__loader__"] is None)
@@ -146,13 +146,13 @@ class RunModuleTest(unittest.TestCase):
try:
if verbose: print("Running from source:", mod_name)
d1 = run_module(mod_name) # Read from source
- self.failUnless(d1["x"] == 1)
+ self.assertEqual(d1["x"], 1)
del d1 # Ensure __loader__ entry doesn't keep file open
__import__(mod_name)
os.remove(mod_fname)
if verbose: print("Running from compiled:", mod_name)
d2 = run_module(mod_name) # Read from bytecode
- self.failUnless(d2["x"] == 1)
+ self.assertEqual(d2["x"], 1)
del d2 # Ensure __loader__ entry doesn't keep file open
finally:
self._del_pkg(pkg_dir, depth, mod_name)