]> granicus.if.org Git - python/commitdiff
Merge testing ABCs for importlib into importlib.test.abc.
authorBrett Cannon <bcannon@gmail.com>
Fri, 30 Jan 2009 00:22:35 +0000 (00:22 +0000)
committerBrett Cannon <bcannon@gmail.com>
Fri, 30 Jan 2009 00:22:35 +0000 (00:22 +0000)
Lib/importlib/test/abc.py [moved from Lib/importlib/test/loader_tests.py with 60% similarity]
Lib/importlib/test/builtin/test_finder.py
Lib/importlib/test/extension/test_finder.py
Lib/importlib/test/finder_tests.py [deleted file]
Lib/importlib/test/frozen/test_finder.py
Lib/importlib/test/source/test_finder.py

similarity index 60%
rename from Lib/importlib/test/loader_tests.py
rename to Lib/importlib/test/abc.py
index 15faf0bf4df479b2b534db5fe7ec22a98b316718..4acbfc90597f3cdeb94244515eb3f8682d09cd1e 100644 (file)
@@ -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
index 5849b5eaea29ac8ed5a632e10e6a2f0c4eb2dfbe..70aed9774e0a0ca444b10d3efb674b9af1ea44e3 100644 (file)
@@ -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."""
 
index 1daa97ad0858d44222ea2381e468b3e5300bf7bc..c22186c68659731baa06e08bf72d6c1574b6269c 100644 (file)
@@ -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 (file)
index 3cf2c95..0000000
+++ /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
index 9dd54b4d383083778afbb26f14960315cca5dba6..8caac484340d1383fea5d01a746f0e7c9638333b 100644 (file)
@@ -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."""
 
index cf80799399af001ee7ec580e0fc92aaf18f2c727..63cb4363a1f9c2e845c7c3a3959f43153d3ceeaf 100644 (file)
@@ -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