diff options
author | Ethan Furman <ethan@stoneleaf.us> | 2014-04-24 21:47:47 (GMT) |
---|---|---|
committer | Ethan Furman <ethan@stoneleaf.us> | 2014-04-24 21:47:47 (GMT) |
commit | 7b9ff0e6da5371214b29053cdb96218e0d2eb655 (patch) | |
tree | da11b0d718916d64a256d36fcc41287aca922e28 /Lib/unittest | |
parent | 7101cb07ef8cb9e63b99b0e1c8200f355841772c (diff) | |
download | cpython-7b9ff0e6da5371214b29053cdb96218e0d2eb655.zip cpython-7b9ff0e6da5371214b29053cdb96218e0d2eb655.tar.gz cpython-7b9ff0e6da5371214b29053cdb96218e0d2eb655.tar.bz2 |
Issue8297: module attribute lookup failures now include module name in error message.
Diffstat (limited to 'Lib/unittest')
-rw-r--r-- | Lib/unittest/test/test_loader.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/unittest/test/test_loader.py b/Lib/unittest/test/test_loader.py index b62a1b5..3e013af 100644 --- a/Lib/unittest/test/test_loader.py +++ b/Lib/unittest/test/test_loader.py @@ -255,7 +255,7 @@ class Test_TestLoader(unittest.TestCase): try: loader.loadTestsFromName('unittest.sdasfasfasdf') except AttributeError as e: - self.assertEqual(str(e), "'module' object has no attribute 'sdasfasfasdf'") + self.assertEqual(str(e), "module 'unittest' has no attribute 'sdasfasfasdf'") else: self.fail("TestLoader.loadTestsFromName failed to raise AttributeError") @@ -272,7 +272,7 @@ class Test_TestLoader(unittest.TestCase): try: loader.loadTestsFromName('sdasfasfasdf', unittest) except AttributeError as e: - self.assertEqual(str(e), "'module' object has no attribute 'sdasfasfasdf'") + self.assertEqual(str(e), "module 'unittest' has no attribute 'sdasfasfasdf'") else: self.fail("TestLoader.loadTestsFromName failed to raise AttributeError") @@ -635,7 +635,7 @@ class Test_TestLoader(unittest.TestCase): try: loader.loadTestsFromNames(['unittest.sdasfasfasdf', 'unittest']) except AttributeError as e: - self.assertEqual(str(e), "'module' object has no attribute 'sdasfasfasdf'") + self.assertEqual(str(e), "module 'unittest' has no attribute 'sdasfasfasdf'") else: self.fail("TestLoader.loadTestsFromNames failed to raise AttributeError") @@ -654,7 +654,7 @@ class Test_TestLoader(unittest.TestCase): try: loader.loadTestsFromNames(['sdasfasfasdf'], unittest) except AttributeError as e: - self.assertEqual(str(e), "'module' object has no attribute 'sdasfasfasdf'") + self.assertEqual(str(e), "module 'unittest' has no attribute 'sdasfasfasdf'") else: self.fail("TestLoader.loadTestsFromName failed to raise AttributeError") @@ -673,7 +673,7 @@ class Test_TestLoader(unittest.TestCase): try: loader.loadTestsFromNames(['TestCase', 'sdasfasfasdf'], unittest) except AttributeError as e: - self.assertEqual(str(e), "'module' object has no attribute 'sdasfasfasdf'") + self.assertEqual(str(e), "module 'unittest' has no attribute 'sdasfasfasdf'") else: self.fail("TestLoader.loadTestsFromName failed to raise AttributeError") |