From: R. David Murray Date: Tue, 21 Dec 2010 18:24:33 +0000 (+0000) Subject: Make test_compileall more robust by using -S to keep sys.path minimized. X-Git-Tag: v3.2rc1~387 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e0436bcb24e266b9391c7fd866224adcb33c5d34;p=python Make test_compileall more robust by using -S to keep sys.path minimized. Try this again, hopefully the right way this time. Arfrever Taifersar Arahesis reported that test_compileall failed during Gentoo install because it was tyring to write .pyc files to a read-only system directory during test_no_args_compiles_path. Having the tests call python with -S should eliminate the system directories from the path. --- diff --git a/Lib/test/test_compileall.py b/Lib/test/test_compileall.py index 3f333a58db..295dc40067 100644 --- a/Lib/test/test_compileall.py +++ b/Lib/test/test_compileall.py @@ -126,13 +126,13 @@ class CommandLineTests(unittest.TestCase): def assertRunOK(self, *args, **env_vars): rc, out, err = script_helper.assert_python_ok( - '-m', 'compileall', *args, **env_vars) + '-S', '-m', 'compileall', *args, **env_vars) self.assertEqual(b'', err) return out def assertRunNotOK(self, *args, **env_vars): rc, out, err = script_helper.assert_python_failure( - '-m', 'compileall', *args, **env_vars) + '-S', '-m', 'compileall', *args, **env_vars) return rc, out, err def assertCompiled(self, fn):