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
f254a751
Commit
f254a751
authored
Jan 30, 2009
by
Brett Cannon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge testing ABCs for importlib into importlib.test.abc.
parent
b18b936e
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
45 additions
and
47 deletions
+45
-47
Lib/importlib/test/abc.py
Lib/importlib/test/abc.py
+37
-0
Lib/importlib/test/builtin/test_finder.py
Lib/importlib/test/builtin/test_finder.py
+2
-2
Lib/importlib/test/extension/test_finder.py
Lib/importlib/test/extension/test_finder.py
+2
-2
Lib/importlib/test/finder_tests.py
Lib/importlib/test/finder_tests.py
+0
-39
Lib/importlib/test/frozen/test_finder.py
Lib/importlib/test/frozen/test_finder.py
+2
-2
Lib/importlib/test/source/test_finder.py
Lib/importlib/test/source/test_finder.py
+2
-2
No files found.
Lib/importlib/test/
loader_tests
.py
→
Lib/importlib/test/
abc
.py
View file @
f254a751
...
...
@@ -2,6 +2,43 @@ import abc
import
unittest
class
FinderTests
(
unittest
.
TestCase
,
metaclass
=
abc
.
ABCMeta
):
"""Basic tests for a finder to pass."""
@
abc
.
abstractmethod
def
test_module
(
self
):
# Test importing a top-level module.
pass
@
abc
.
abstractmethod
def
test_package
(
self
):
# Test importing a package.
pass
@
abc
.
abstractmethod
def
test_module_in_package
(
self
):
# Test importing a module contained within a package.
# A value for 'path' should be used if for a meta_path finder.
pass
@
abc
.
abstractmethod
def
test_package_in_package
(
self
):
# Test importing a subpackage.
# A value for 'path' should be used if for a meta_path finder.
pass
@
abc
.
abstractmethod
def
test_package_over_module
(
self
):
# Test that packages are chosen over modules.
pass
@
abc
.
abstractmethod
def
test_failure
(
self
):
# Test trying to find a module that cannot be handled.
pass
class
LoaderTests
(
unittest
.
TestCase
,
metaclass
=
abc
.
ABCMeta
):
@
abc
.
abstractmethod
...
...
Lib/importlib/test/builtin/test_finder.py
View file @
f254a751
from
importlib
import
machinery
from
..
import
finder_tests
from
..
import
abc
from
..
import
support
import
sys
import
unittest
class
FinderTests
(
finder_tests
.
FinderTests
):
class
FinderTests
(
abc
.
FinderTests
):
"""Test find_module() for built-in modules."""
...
...
Lib/importlib/test/extension/test_finder.py
View file @
f254a751
import
importlib
from
..
import
finder_tests
from
..
import
abc
from
.
import
test_path_hook
import
unittest
class
FinderTests
(
finder_tests
.
FinderTests
):
class
FinderTests
(
abc
.
FinderTests
):
"""Test the finder for extension modules."""
...
...
Lib/importlib/test/finder_tests.py
deleted
100644 → 0
View file @
b18b936e
import
abc
import
unittest
class
FinderTests
(
unittest
.
TestCase
,
metaclass
=
abc
.
ABCMeta
):
"""Basic tests for a finder to pass."""
@
abc
.
abstractmethod
def
test_module
(
self
):
# Test importing a top-level module.
pass
@
abc
.
abstractmethod
def
test_package
(
self
):
# Test importing a package.
pass
@
abc
.
abstractmethod
def
test_module_in_package
(
self
):
# Test importing a module contained within a package.
# A value for 'path' should be used if for a meta_path finder.
pass
@
abc
.
abstractmethod
def
test_package_in_package
(
self
):
# Test importing a subpackage.
# A value for 'path' should be used if for a meta_path finder.
pass
@
abc
.
abstractmethod
def
test_package_over_module
(
self
):
# Test that packages are chosen over modules.
pass
@
abc
.
abstractmethod
def
test_failure
(
self
):
# Test trying to find a module that cannot be handled.
pass
Lib/importlib/test/frozen/test_finder.py
View file @
f254a751
from
...
import
machinery
from
..
import
finder_tests
from
..
import
abc
import
unittest
class
FinderTests
(
finder_tests
.
FinderTests
):
class
FinderTests
(
abc
.
FinderTests
):
"""Test finding frozen modules."""
...
...
Lib/importlib/test/source/test_finder.py
View file @
f254a751
import
importlib
from
..
import
finder_tests
from
..
import
abc
from
..
import
support
import
os
import
py_compile
...
...
@@ -7,7 +7,7 @@ import unittest
import
warnings
class
FinderTests
(
finder_tests
.
FinderTests
):
class
FinderTests
(
abc
.
FinderTests
):
"""For a top-level module, it should just be found directly in the
directory being searched. This is true for a directory with source
...
...
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