summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_cmd_line_script.py
diff options
context:
space:
mode:
authorNick Coghlan <ncoghlan@gmail.com>2013-07-28 12:11:50 (GMT)
committerNick Coghlan <ncoghlan@gmail.com>2013-07-28 12:11:50 (GMT)
commit5517596c0428ee3620c28fd68ba5a0b1627d59b6 (patch)
tree8d1fa6b14c787305bbf7e8c382fcbbe6f9aaf9ad /Lib/test/test_cmd_line_script.py
parent69e3bda310f55816403e4c7fda42ab96d81c31be (diff)
downloadcpython-5517596c0428ee3620c28fd68ba5a0b1627d59b6.zip
cpython-5517596c0428ee3620c28fd68ba5a0b1627d59b6.tar.gz
cpython-5517596c0428ee3620c28fd68ba5a0b1627d59b6.tar.bz2
Close #15415: Factor out temp dir helpers to test.support
Patch by Chris Jerdonek
Diffstat (limited to 'Lib/test/test_cmd_line_script.py')
-rw-r--r--Lib/test/test_cmd_line_script.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/test/test_cmd_line_script.py b/Lib/test/test_cmd_line_script.py
index 6051e18..b4269b9 100644
--- a/Lib/test/test_cmd_line_script.py
+++ b/Lib/test/test_cmd_line_script.py
@@ -290,7 +290,7 @@ class CmdLineTest(unittest.TestCase):
# Make sure package __init__ modules see "-m" in sys.argv0 while
# searching for the module to execute
with temp_dir() as script_dir:
- with support.temp_cwd(path=script_dir):
+ with support.change_cwd(path=script_dir):
pkg_dir = os.path.join(script_dir, 'test_pkg')
make_pkg(pkg_dir, "import sys; print('init_argv0==%r' % sys.argv[0])")
script_name = _make_test_script(pkg_dir, 'script')
@@ -307,7 +307,7 @@ class CmdLineTest(unittest.TestCase):
# Make sure a "-c" file in the current directory
# does not alter the value of sys.path[0]
with temp_dir() as script_dir:
- with support.temp_cwd(path=script_dir):
+ with support.change_cwd(path=script_dir):
with open("-c", "w") as f:
f.write("data")
rc, out, err = assert_python_ok('-c',
@@ -322,7 +322,7 @@ class CmdLineTest(unittest.TestCase):
# does not alter the value of sys.path[0]
with temp_dir() as script_dir:
script_name = _make_test_script(script_dir, 'other')
- with support.temp_cwd(path=script_dir):
+ with support.change_cwd(path=script_dir):
with open("-m", "w") as f:
f.write("data")
rc, out, err = assert_python_ok('-m', 'other', *example_args)
@@ -335,7 +335,7 @@ class CmdLineTest(unittest.TestCase):
# and results in an error that the return code to the
# shell is '1'
with temp_dir() as script_dir:
- with support.temp_cwd(path=script_dir):
+ with support.change_cwd(path=script_dir):
pkg_dir = os.path.join(script_dir, 'test_pkg')
make_pkg(pkg_dir)
script_name = _make_test_script(pkg_dir, 'other',