summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_py_compile.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2015-09-06 11:15:40 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2015-09-06 11:15:40 (GMT)
commit8fecd42d2658ce0a2f25e9ea240a87b4a5241870 (patch)
treee90f26c350c8625f1f40523606787a06f2f28efb /Lib/test/test_py_compile.py
parent643d6d31357d7278fa1e04177ab455c505ec9031 (diff)
parent5fbadb63ef2a3d7645396e1f11fe9303883c7e65 (diff)
downloadcpython-8fecd42d2658ce0a2f25e9ea240a87b4a5241870.zip
cpython-8fecd42d2658ce0a2f25e9ea240a87b4a5241870.tar.gz
cpython-8fecd42d2658ce0a2f25e9ea240a87b4a5241870.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 03cca5d..4a6caa5 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))