summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_py_compile.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2015-09-06 11:13:25 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2015-09-06 11:13:25 (GMT)
commit2a23adf4405bcd903aabf445dd54867d95f494a1 (patch)
treefc4c823138cb505c180873976bc0a41ac3a1f6d5 /Lib/test/test_py_compile.py
parentef920d6d5e38cebd51b17001d614b55b1c468041 (diff)
downloadcpython-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.py8
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))