diff options
author | Brett Cannon <bcannon@gmail.com> | 2009-02-01 04:00:05 (GMT) |
---|---|---|
committer | Brett Cannon <bcannon@gmail.com> | 2009-02-01 04:00:05 (GMT) |
commit | bcb26c53c095c7bcd0e5415088e25dbd27f12592 (patch) | |
tree | 35240e335dd91a385c13935ddc64b33d9c17a8ad /Lib/importlib/test/frozen | |
parent | ae9ad186d058c5700d0692e2f3b026e95639f5cf (diff) | |
download | cpython-bcb26c53c095c7bcd0e5415088e25dbd27f12592.zip cpython-bcb26c53c095c7bcd0e5415088e25dbd27f12592.tar.gz cpython-bcb26c53c095c7bcd0e5415088e25dbd27f12592.tar.bz2 |
Rename importlib.test.support to importlib.test.util.
Diffstat (limited to 'Lib/importlib/test/frozen')
-rw-r--r-- | Lib/importlib/test/frozen/support.py | 24 | ||||
-rw-r--r-- | Lib/importlib/test/frozen/test_loader.py | 10 |
2 files changed, 5 insertions, 29 deletions
diff --git a/Lib/importlib/test/frozen/support.py b/Lib/importlib/test/frozen/support.py deleted file mode 100644 index e08b89e..0000000 --- a/Lib/importlib/test/frozen/support.py +++ /dev/null @@ -1,24 +0,0 @@ -import sys - - -class Null: - - """Just absorb what is given.""" - - def __getattr__(self): - return lambda *args, **kwargs: None - - -class SilenceStdout: - - """Silence sys.stdout.""" - - def setUp(self): - """Substitute sys.stdout with something that does not print to the - screen thanks to what bytecode is frozen.""" - sys.stdout = Null() - super().setUp() - - def tearDown(self): - sys.stdout = sys.__stdout__ - super().tearDown() diff --git a/Lib/importlib/test/frozen/test_loader.py b/Lib/importlib/test/frozen/test_loader.py index 63a9742..c6f4463 100644 --- a/Lib/importlib/test/frozen/test_loader.py +++ b/Lib/importlib/test/frozen/test_loader.py @@ -1,12 +1,12 @@ from importlib import machinery from .. import abc -from .. import support +from .. import util class LoaderTests(abc.LoaderTests): def test_module(self): - with support.uncache('__hello__'): + with util.uncache('__hello__'): module = machinery.FrozenImporter.load_module('__hello__') check = {'__name__': '__hello__', '__file__': '<frozen>', '__package__': None} @@ -14,7 +14,7 @@ class LoaderTests(abc.LoaderTests): self.assertEqual(getattr(module, attr), value) def test_package(self): - with support.uncache('__phello__'): + with util.uncache('__phello__'): module = machinery.FrozenImporter.load_module('__phello__') check = {'__name__': '__phello__', '__file__': '<frozen>', '__package__': '__phello__', '__path__': ['__phello__']} @@ -25,7 +25,7 @@ class LoaderTests(abc.LoaderTests): (attr, attr_value, value)) def test_lacking_parent(self): - with support.uncache('__phello__', '__phello__.spam'): + with util.uncache('__phello__', '__phello__.spam'): module = machinery.FrozenImporter.load_module('__phello__.spam') check = {'__name__': '__phello__.spam', '__file__': '<frozen>', '__package__': '__phello__'} @@ -36,7 +36,7 @@ class LoaderTests(abc.LoaderTests): (attr, attr_value, value)) def test_module_reuse(self): - with support.uncache('__hello__'): + with util.uncache('__hello__'): module1 = machinery.FrozenImporter.load_module('__hello__') module2 = machinery.FrozenImporter.load_module('__hello__') self.assert_(module1 is module2) |