summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_cmd_line_script.py
diff options
context:
space:
mode:
authorMartin Panter <vadmium+py@gmail.com>2015-12-10 06:47:06 (GMT)
committerMartin Panter <vadmium+py@gmail.com>2015-12-10 06:47:06 (GMT)
commit7dda421bfff887da9a84e99c37ef1b0ef9f3cde9 (patch)
treee39c07f91360571424cb92263f3f34434c974ec4 /Lib/test/test_cmd_line_script.py
parenta29eb08fb97fff461b62682da4ee9ac6ea8db5bf (diff)
downloadcpython-7dda421bfff887da9a84e99c37ef1b0ef9f3cde9.zip
cpython-7dda421bfff887da9a84e99c37ef1b0ef9f3cde9.tar.gz
cpython-7dda421bfff887da9a84e99c37ef1b0ef9f3cde9.tar.bz2
Issue #14285: Do not catch exceptions initializing any ancestor package
The previous fix only handled the case of the parent package of __main__ failing to initialize. Also make the "Error while finding spec" formatting slightly more appealing, and document and test that the module name must be absolute.
Diffstat (limited to 'Lib/test/test_cmd_line_script.py')
-rw-r--r--Lib/test/test_cmd_line_script.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/Lib/test/test_cmd_line_script.py b/Lib/test/test_cmd_line_script.py
index 77cb95c..96711d6 100644
--- a/Lib/test/test_cmd_line_script.py
+++ b/Lib/test/test_cmd_line_script.py
@@ -433,6 +433,7 @@ class CmdLineTest(unittest.TestCase):
('importlib', br'No module named.*'
br'is a package and cannot be directly executed'),
('importlib.nonexistant', br'No module named'),
+ ('.unittest', br'Relative module names not supported'),
)
for name, regex in tests:
with self.subTest(name):