Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
7e0a1815
Commit
7e0a1815
authored
Aug 23, 2013
by
Brett Cannon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make test_import more robust and stop using assertRaisesRegexp().
parent
a93c6db6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
Lib/test/test_import.py
Lib/test/test_import.py
+3
-2
No files found.
Lib/test/test_import.py
View file @
7e0a1815
...
...
@@ -322,11 +322,11 @@ class ImportTests(unittest.TestCase):
self
.
assertIn
(
b"ImportError"
,
stdout
)
def
test_from_import_message_for_nonexistent_module
(
self
):
with
self
.
assertRaisesRegex
p
(
ImportError
,
"^No module named 'bogus'"
):
with
self
.
assertRaisesRegex
(
ImportError
,
"^No module named 'bogus'"
):
from
bogus
import
foo
def
test_from_import_message_for_existing_module
(
self
):
with
self
.
assertRaisesRegex
p
(
ImportError
,
"^cannot import name 'bogus'"
):
with
self
.
assertRaisesRegex
(
ImportError
,
"^cannot import name 'bogus'"
):
from
re
import
bogus
...
...
@@ -689,6 +689,7 @@ class PycacheTests(unittest.TestCase):
self
.
assertTrue
(
os
.
path
.
exists
(
pyc_file
))
os
.
remove
(
self
.
source
)
forget
(
TESTFN
)
importlib
.
invalidate_caches
()
self
.
assertRaises
(
ImportError
,
__import__
,
TESTFN
)
@
skip_if_dont_write_bytecode
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment