summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrett Cannon <bcannon@gmail.com>2009-01-30 00:22:35 (GMT)
committerBrett Cannon <bcannon@gmail.com>2009-01-30 00:22:35 (GMT)
commitf254a75176928e1d1228a5d20d49fbe2fe9f290a (patch)
tree7ec25bc4398a7258f0eb7810ffbad1b0ba8c3bd3
parentb18b936e797379b13a15604a76bbb9e1e0bcf5fe (diff)
downloadcpython-f254a75176928e1d1228a5d20d49fbe2fe9f290a.zip
cpython-f254a75176928e1d1228a5d20d49fbe2fe9f290a.tar.gz
cpython-f254a75176928e1d1228a5d20d49fbe2fe9f290a.tar.bz2
Merge testing ABCs for importlib into importlib.test.abc.
-rw-r--r--Lib/importlib/test/abc.py (renamed from Lib/importlib/test/loader_tests.py)37
-rw-r--r--Lib/importlib/test/builtin/test_finder.py4
-rw-r--r--Lib/importlib/test/extension/test_finder.py4
-rw-r--r--Lib/importlib/test/finder_tests.py39
-rw-r--r--Lib/importlib/test/frozen/test_finder.py4
-rw-r--r--Lib/importlib/test/source/test_finder.py4
6 files changed, 45 insertions, 47 deletions
diff --git a/Lib/importlib/test/loader_tests.py b/Lib/importlib/test/abc.py
index 15faf0b..4acbfc9 100644
--- a/Lib/importlib/test/loader_tests.py
+++ b/Lib/importlib/test/abc.py
@@ -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
diff --git a/Lib/importlib/test/builtin/test_finder.py b/Lib/importlib/test/builtin/test_finder.py
index 5849b5e..70aed97 100644
--- a/Lib/importlib/test/builtin/test_finder.py
+++ b/Lib/importlib/test/builtin/test_finder.py
@@ -1,11 +1,11 @@
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."""
diff --git a/Lib/importlib/test/extension/test_finder.py b/Lib/importlib/test/extension/test_finder.py
index 1daa97a..c22186c 100644
--- a/Lib/importlib/test/extension/test_finder.py
+++ b/Lib/importlib/test/extension/test_finder.py
@@ -1,10 +1,10 @@
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."""
diff --git a/Lib/importlib/test/finder_tests.py b/Lib/importlib/test/finder_tests.py
deleted file mode 100644
index 3cf2c95..0000000
--- a/Lib/importlib/test/finder_tests.py
+++ /dev/null
@@ -1,39 +0,0 @@
-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
diff --git a/Lib/importlib/test/frozen/test_finder.py b/Lib/importlib/test/frozen/test_finder.py
index 9dd54b4..8caac48 100644
--- a/Lib/importlib/test/frozen/test_finder.py
+++ b/Lib/importlib/test/frozen/test_finder.py
@@ -1,10 +1,10 @@
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."""
diff --git a/Lib/importlib/test/source/test_finder.py b/Lib/importlib/test/source/test_finder.py
index cf80799..63cb436 100644
--- a/Lib/importlib/test/source/test_finder.py
+++ b/Lib/importlib/test/source/test_finder.py
@@ -1,5 +1,5 @@
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