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
1d0b43d2
Commit
1d0b43d2
authored
Jan 27, 2009
by
Brett Cannon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move importlib.test.builtin.test_finder over to importlib.test.finder_tests.
parent
97c8a07f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
8 deletions
+27
-8
Lib/importlib/test/builtin/test_finder.py
Lib/importlib/test/builtin/test_finder.py
+27
-8
No files found.
Lib/importlib/test/builtin/test_finder.py
View file @
1d0b43d2
from
importlib
import
machinery
from
..
import
finder_tests
from
..
import
support
import
sys
import
unittest
class
FinderTests
(
unittest
.
TestCase
):
class
FinderTests
(
finder_tests
.
FinderTests
):
"""Test find_module() for built-in modules."""
assert
'errno'
in
sys
.
builtin_module_names
name
=
'errno'
find_module
=
staticmethod
(
lambda
name
,
path
=
None
:
machinery
.
BuiltinImporter
.
find_module
(
name
,
path
))
def
test_find_module
(
self
):
def
test_module
(
self
):
# Common case.
with
support
.
uncache
(
self
.
name
):
self
.
assert_
(
self
.
find_module
(
self
.
name
))
self
.
assert_
(
machinery
.
BuiltinImporter
.
find_module
(
self
.
name
))
def
test_package
(
self
):
# Built-in modules cannot be a package.
pass
def
test_module_in_package
(
self
):
# Built-in modules cannobt be in a package.
pass
def
test_package_in_package
(
self
):
# Built-in modules cannot be a package.
pass
def
test_package_over_module
(
self
):
# Built-in modules cannot be a package.
pass
def
test_failure
(
self
):
assert
'importlib'
not
in
sys
.
builtin_module_names
loader
=
machinery
.
BuiltinImporter
.
find_module
(
'importlib'
)
self
.
assert_
(
loader
is
None
)
def
test_ignore_path
(
self
):
# The value for 'path' should always trigger a failed import.
with
support
.
uncache
(
self
.
name
):
self
.
assert_
(
self
.
find_module
(
self
.
name
,
[
'pkg'
])
is
None
)
loader
=
machinery
.
BuiltinImporter
.
find_module
(
self
.
name
,
[
'pkg'
])
self
.
assert_
(
loader
is
None
)
...
...
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