Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(38321)

Unified Diff: Lib/test/test_runpy.py

Issue 14285: Traceback wrong on ImportError while executing a package
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Lib/test/test_cmd_line_script.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
--- a/Lib/test/test_runpy.py Thu Dec 03 22:27:31 2015 +0200
+++ b/Lib/test/test_runpy.py Sun Dec 06 23:23:35 2015 +0000
@@ -197,8 +197,11 @@
self.expect_import_error("sys.imp.eric")
self.expect_import_error("os.path.half")
self.expect_import_error("a.bee")
+ # Relative names not allowed
self.expect_import_error(".howard")
self.expect_import_error("..eaten")
+ self.expect_import_error(".test_runpy")
+ self.expect_import_error(".unittest")
# Package without __main__.py
self.expect_import_error("multiprocessing")
@@ -460,6 +463,12 @@
self.assertNotIn("finding spec", format(err))
else:
self.fail("Nothing raised; expected {}".format(name))
+ try:
+ run_module(mod_name + ".submodule")
+ except exception as err:
+ self.assertNotIn("finding spec", format(err))
+ else:
+ self.fail("Nothing raised; expected {}".format(name))
def test_run_package_in_namespace_package(self):
for depth in range(1, 4):
« no previous file with comments | « Lib/test/test_cmd_line_script.py ('k') | no next file » | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+