summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBerker Peksag <berker.peksag@gmail.com>2016-09-28 14:39:20 (GMT)
committerBerker Peksag <berker.peksag@gmail.com>2016-09-28 14:39:20 (GMT)
commite075537432e8d84a92fc314927f1d7a80879669b (patch)
treefc7ad1fcd6df539bd9707a28a0ca62fd374bd68a
parentdbd9cbf8f34259cb36fa39592762daf5ca620abf (diff)
parent408b78c06f73ad2546e6fcb93e6dcef7d248f4a1 (diff)
downloadcpython-e075537432e8d84a92fc314927f1d7a80879669b.zip
cpython-e075537432e8d84a92fc314927f1d7a80879669b.tar.gz
cpython-e075537432e8d84a92fc314927f1d7a80879669b.tar.bz2
Issue #27322: Merge from 3.6
-rw-r--r--Lib/test/test_compileall.py15
1 files changed, 2 insertions, 13 deletions
diff --git a/Lib/test/test_compileall.py b/Lib/test/test_compileall.py
index 9b424a7..1f05e78 100644
--- a/Lib/test/test_compileall.py
+++ b/Lib/test/test_compileall.py
@@ -103,19 +103,8 @@ class CompileallTests(unittest.TestCase):
force=False, quiet=2))
def test_compile_path(self):
- # Exclude Lib/test/ which contains invalid Python files like
- # Lib/test/badsyntax_pep3120.py
- testdir = os.path.realpath(os.path.dirname(__file__))
- if testdir in sys.path:
- self.addCleanup(setattr, sys, 'path', sys.path)
-
- sys.path = list(sys.path)
- try:
- sys.path.remove(testdir)
- except ValueError:
- pass
-
- self.assertTrue(compileall.compile_path(quiet=2))
+ with test.test_importlib.util.import_state(path=[self.directory]):
+ self.assertTrue(compileall.compile_path(quiet=2))
with test.test_importlib.util.import_state(path=[self.directory]):
self.add_bad_source_file()