Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(275404)

Unified Diff: Lib/test/test_compileall.py

Issue 26101: Lib/test/test_compileall.py fails when run directly
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
--- a/Lib/test/test_compileall.py Wed Jan 13 07:48:57 2016 -0800
+++ b/Lib/test/test_compileall.py Wed Jan 13 17:37:18 2016 +0100
@@ -103,6 +103,18 @@ 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]):
« no previous file with comments | « no previous file | no next file » | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+