diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2015-09-06 11:13:25 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2015-09-06 11:13:25 (GMT) |
commit | 2a23adf4405bcd903aabf445dd54867d95f494a1 (patch) | |
tree | fc4c823138cb505c180873976bc0a41ac3a1f6d5 /Lib/test/test_py_compile.py | |
parent | ef920d6d5e38cebd51b17001d614b55b1c468041 (diff) | |
download | cpython-2a23adf4405bcd903aabf445dd54867d95f494a1.zip cpython-2a23adf4405bcd903aabf445dd54867d95f494a1.tar.gz cpython-2a23adf4405bcd903aabf445dd54867d95f494a1.tar.bz2 |
Use support.change_cwd() in tests.
Diffstat (limited to 'Lib/test/test_py_compile.py')
-rw-r--r-- | Lib/test/test_py_compile.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/Lib/test/test_py_compile.py b/Lib/test/test_py_compile.py index 1abea27..c1fd4f6 100644 --- a/Lib/test/test_py_compile.py +++ b/Lib/test/test_py_compile.py @@ -63,11 +63,9 @@ class PyCompileTests(unittest.TestCase): self.assertTrue(os.path.exists(self.cache_path)) def test_cwd(self): - cwd = os.getcwd() - os.chdir(self.directory) - py_compile.compile(os.path.basename(self.source_path), - os.path.basename(self.pyc_path)) - os.chdir(cwd) + with support.change_cwd(self.directory): + py_compile.compile(os.path.basename(self.source_path), + os.path.basename(self.pyc_path)) self.assertTrue(os.path.exists(self.pyc_path)) self.assertFalse(os.path.exists(self.cache_path)) |