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
917558e9
Commit
917558e9
authored
Dec 15, 2012
by
Andrew Svetlov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename test module names for #16421 to don't clash with other tests.
parent
5c3fe5a7
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
10 deletions
+10
-10
Lib/test/test_imp.py
Lib/test/test_imp.py
+4
-4
Modules/_testimportmultiple.c
Modules/_testimportmultiple.c
+6
-6
No files found.
Lib/test/test_imp.py
View file @
917558e9
...
...
@@ -223,11 +223,11 @@ class ImportTests(unittest.TestCase):
fileobj
,
pathname
,
description
=
imp
.
find_module
(
m
)
fileobj
.
close
()
mod0
=
imp
.
load_dynamic
(
m
,
pathname
)
mod1
=
imp
.
load_dynamic
(
'foo'
,
pathname
)
mod2
=
imp
.
load_dynamic
(
'bar'
,
pathname
)
mod1
=
imp
.
load_dynamic
(
'
_testimportmultiple_
foo'
,
pathname
)
mod2
=
imp
.
load_dynamic
(
'
_testimportmultiple_
bar'
,
pathname
)
self
.
assertEqual
(
mod0
.
__name__
,
m
)
self
.
assertEqual
(
mod1
.
__name__
,
'foo'
)
self
.
assertEqual
(
mod2
.
__name__
,
'bar'
)
self
.
assertEqual
(
mod1
.
__name__
,
'
_testimportmultiple_
foo'
)
self
.
assertEqual
(
mod2
.
__name__
,
'
_testimportmultiple_
bar'
)
with
self
.
assertRaises
(
ImportError
):
imp
.
load_dynamic
(
'nonexistent'
,
pathname
)
...
...
Modules/_testimportmultiple.c
View file @
917558e9
...
...
@@ -24,8 +24,8 @@ PyMODINIT_FUNC PyInit__testimportmultiple()
static
struct
PyModuleDef
_foomodule
=
{
PyModuleDef_HEAD_INIT
,
"foo"
,
"foo doc"
,
"
_testimportmultiple_
foo"
,
"
_testimportmultiple_
foo doc"
,
-
1
,
NULL
,
NULL
,
...
...
@@ -34,15 +34,15 @@ static struct PyModuleDef _foomodule = {
NULL
};
PyMODINIT_FUNC
PyInit_foo
()
PyMODINIT_FUNC
PyInit_
_testimportmultiple_
foo
()
{
return
PyModule_Create
(
&
_foomodule
);
}
static
struct
PyModuleDef
_barmodule
=
{
PyModuleDef_HEAD_INIT
,
"bar"
,
"bar doc"
,
"
_testimportmultiple_
bar"
,
"
_testimportmultiple_
bar doc"
,
-
1
,
NULL
,
NULL
,
...
...
@@ -51,7 +51,7 @@ static struct PyModuleDef _barmodule = {
NULL
};
PyMODINIT_FUNC
PyInit_bar
(){
PyMODINIT_FUNC
PyInit_
_testimportmultiple_
bar
(){
return
PyModule_Create
(
&
_barmodule
);
}
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