diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-03-14 19:15:47 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-03-14 19:15:47 (GMT) |
commit | 98dbba5d209dda5300df549ef26eb4646cb891f0 (patch) | |
tree | e51f3164127b11333fed8d717ba7bed7bbc54645 /Lib | |
parent | ccbf475dfde5ef643bf9559b46e97fa9b35ef5d3 (diff) | |
download | cpython-98dbba5d209dda5300df549ef26eb4646cb891f0.zip cpython-98dbba5d209dda5300df549ef26eb4646cb891f0.tar.gz cpython-98dbba5d209dda5300df549ef26eb4646cb891f0.tar.bz2 |
Issue #3080: Use repr() to format the module name on error
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_pydoc.py | 2 | ||||
-rw-r--r-- | Lib/unittest/test/test_loader.py | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/Lib/test/test_pydoc.py b/Lib/test/test_pydoc.py index fc4146c..0ecf6a5 100644 --- a/Lib/test/test_pydoc.py +++ b/Lib/test/test_pydoc.py @@ -190,7 +190,7 @@ war</tt></dd></dl> missing_pattern = "no Python documentation found for '%s'" # output pattern for module with bad imports -badimport_pattern = "problem in %s - ImportError: No module named %s" +badimport_pattern = "problem in %s - ImportError: No module named %r" def run_pydoc(module_name, *args): """ diff --git a/Lib/unittest/test/test_loader.py b/Lib/unittest/test/test_loader.py index f7e31a5..d1b9ef5 100644 --- a/Lib/unittest/test/test_loader.py +++ b/Lib/unittest/test/test_loader.py @@ -239,7 +239,7 @@ class Test_TestLoader(unittest.TestCase): try: loader.loadTestsFromName('sdasfasfasdf') except ImportError as e: - self.assertEqual(str(e), "No module named sdasfasfasdf") + self.assertEqual(str(e), "No module named 'sdasfasfasdf'") else: self.fail("TestLoader.loadTestsFromName failed to raise ImportError") @@ -619,7 +619,7 @@ class Test_TestLoader(unittest.TestCase): try: loader.loadTestsFromNames(['sdasfasfasdf']) except ImportError as e: - self.assertEqual(str(e), "No module named sdasfasfasdf") + self.assertEqual(str(e), "No module named 'sdasfasfasdf'") else: self.fail("TestLoader.loadTestsFromNames failed to raise ImportError") |