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
8709b236
Commit
8709b236
authored
May 15, 2018
by
Barry Warsaw
Committed by
GitHub
May 15, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bpo-33465: Use an unlikely to be built-in C extension in a test (#6797)
parent
389a48ed
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
Lib/test/test_import/__init__.py
Lib/test/test_import/__init__.py
+6
-5
No files found.
Lib/test/test_import/__init__.py
View file @
8709b236
...
...
@@ -90,13 +90,14 @@ class ImportTests(unittest.TestCase):
self
.
assertEqual
(
cm
.
exception
.
path
,
os
.
__file__
)
self
.
assertRegex
(
str
(
cm
.
exception
),
r"cannot import name 'i_dont_exist' from 'os' \
(.*os.py
\)"
)
@
cpython_only
def
test_from_import_missing_attr_has_name_and_so_path
(
self
):
import
select
import
_testcapi
with
self
.
assertRaises
(
ImportError
)
as
cm
:
from
select
import
i_dont_exist
self
.
assertEqual
(
cm
.
exception
.
name
,
'
select
'
)
self
.
assertEqual
(
cm
.
exception
.
path
,
select
.
__file__
)
self
.
assertRegex
(
str
(
cm
.
exception
),
r"cannot import name 'i_dont_exist' from '
select
' \
(.*
\.(so|pyd)\
)
")
from
_testcapi
import
i_dont_exist
self
.
assertEqual
(
cm
.
exception
.
name
,
'
_testcapi
'
)
self
.
assertEqual
(
cm
.
exception
.
path
,
_testcapi
.
__file__
)
self
.
assertRegex
(
str
(
cm
.
exception
),
r"cannot import name 'i_dont_exist' from '
_testcapi
' \
(.*
\.(so|pyd)\
)
")
def test_from_import_missing_attr_has_name(self):
with self.assertRaises(ImportError) as cm:
...
...
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