summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_py_compile.py
diff options
context:
space:
mode:
authorMeador Inge <meadori@gmail.com>2011-11-28 15:34:47 (GMT)
committerMeador Inge <meadori@gmail.com>2011-11-28 15:34:47 (GMT)
commit31b798d3c8592c84d36c7c9134a0bcbcb39dd92e (patch)
tree87bd63049b10be3c646131d626c417736caf2cae /Lib/test/test_py_compile.py
parentd1b097f8844d5e711c55874baba45b792cf46055 (diff)
parent22b9b379159f953ad4805980644414354030624f (diff)
downloadcpython-31b798d3c8592c84d36c7c9134a0bcbcb39dd92e.zip
cpython-31b798d3c8592c84d36c7c9134a0bcbcb39dd92e.tar.gz
cpython-31b798d3c8592c84d36c7c9134a0bcbcb39dd92e.tar.bz2
Issue #12618: py_compile cannot create files in current directory
Initial patch by Sjoerd de Vries.
Diffstat (limited to 'Lib/test/test_py_compile.py')
-rw-r--r--Lib/test/test_py_compile.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_py_compile.py b/Lib/test/test_py_compile.py
index 8ad0897..f3c1a6a 100644
--- a/Lib/test/test_py_compile.py
+++ b/Lib/test/test_py_compile.py
@@ -39,6 +39,15 @@ class PyCompileTests(unittest.TestCase):
py_compile.compile(self.source_path)
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)
+ self.assertTrue(os.path.exists(self.pyc_path))
+ self.assertFalse(os.path.exists(self.cache_path))
+
def test_relative_path(self):
py_compile.compile(os.path.relpath(self.source_path),
os.path.relpath(self.pyc_path))