mirror of
https://github.com/python/cpython.git
synced 2025-10-07 07:31:46 +00:00
Issue #27487: Merge runpy warning from 3.5
This commit is contained in:
commit
f9ed528faf
4 changed files with 52 additions and 11 deletions
|
@ -425,8 +425,9 @@ class CmdLineTest(unittest.TestCase):
|
|||
# Exercise error reporting for various invalid package executions
|
||||
tests = (
|
||||
('builtins', br'No code object available'),
|
||||
('builtins.x', br'Error while finding spec.*AttributeError'),
|
||||
('builtins.x.y', br'Error while finding spec.*'
|
||||
('builtins.x', br'Error while finding module specification.*'
|
||||
br'AttributeError'),
|
||||
('builtins.x.y', br'Error while finding module specification.*'
|
||||
br'ImportError.*No module named.*not a package'),
|
||||
('os.path', br'loader.*cannot handle'),
|
||||
('importlib', br'No module named.*'
|
||||
|
@ -449,7 +450,8 @@ class CmdLineTest(unittest.TestCase):
|
|||
with open('test_pkg/__init__.pyc', 'wb'):
|
||||
pass
|
||||
err = self.check_dash_m_failure('test_pkg')
|
||||
self.assertRegex(err, br'Error while finding spec.*'
|
||||
self.assertRegex(err,
|
||||
br'Error while finding module specification.*'
|
||||
br'ImportError.*bad magic number')
|
||||
self.assertNotIn(b'is a package', err)
|
||||
self.assertNotIn(b'Traceback', err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue