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
f9179378
Commit
f9179378
authored
Jun 12, 2013
by
Brett Cannon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move code from test_importhooks into test_zipimport.
parent
6eeb430a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
1 deletion
+25
-1
Lib/test/test_zipimport.py
Lib/test/test_zipimport.py
+25
-1
No files found.
Lib/test/test_zipimport.py
View file @
f9179378
...
...
@@ -7,7 +7,6 @@ import time
import
unittest
from
test
import
support
from
test.test_importhooks
import
ImportHooksBaseTestCase
,
test_src
,
test_co
from
zipfile
import
ZipFile
,
ZipInfo
,
ZIP_STORED
,
ZIP_DEFLATED
...
...
@@ -17,6 +16,14 @@ import doctest
import
inspect
import
io
from
traceback
import
extract_tb
,
extract_stack
,
print_tb
test_src
=
"""
\
def get_name():
return __name__
def get_file():
return __file__
"""
test_co
=
compile
(
test_src
,
"<???>"
,
"exec"
)
raise_src
=
'def do_raise(): raise TypeError
\
n
'
def
make_pyc
(
co
,
mtime
,
size
):
...
...
@@ -46,6 +53,23 @@ pyc_file = imp.cache_from_source(TESTMOD + '.py')
pyc_ext
=
(
'.pyc'
if
__debug__
else
'.pyo'
)
class
ImportHooksBaseTestCase
(
unittest
.
TestCase
):
def
setUp
(
self
):
self
.
path
=
sys
.
path
[:]
self
.
meta_path
=
sys
.
meta_path
[:]
self
.
path_hooks
=
sys
.
path_hooks
[:]
sys
.
path_importer_cache
.
clear
()
self
.
modules_before
=
support
.
modules_setup
()
def
tearDown
(
self
):
sys
.
path
[:]
=
self
.
path
sys
.
meta_path
[:]
=
self
.
meta_path
sys
.
path_hooks
[:]
=
self
.
path_hooks
sys
.
path_importer_cache
.
clear
()
support
.
modules_cleanup
(
*
self
.
modules_before
)
class
UncompressedZipImportTestCase
(
ImportHooksBaseTestCase
):
compression
=
ZIP_STORED
...
...
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