summaryrefslogtreecommitdiff
path: root/Lib/test/test_shutil.py
diff options
context:
space:
mode:
authorNick Coghlan <ncoghlan@gmail.com>2013-07-28 22:25:25 +1000
committerNick Coghlan <ncoghlan@gmail.com>2013-07-28 22:25:25 +1000
commitcf67b2a8916df3a696050b3ba36ac8049c9961f9 (patch)
tree750b0c3d2de058b15644cd25d111112ab8f94f84 /Lib/test/test_shutil.py
parentb8de598305428608fad9d95e890293dee4938faf (diff)
parent5517596c0428ee3620c28fd68ba5a0b1627d59b6 (diff)
downloadcpython-git-cf67b2a8916df3a696050b3ba36ac8049c9961f9.tar.gz
Merge #15415 from 3.3
Diffstat (limited to 'Lib/test/test_shutil.py')
-rw-r--r--Lib/test/test_shutil.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/test/test_shutil.py b/Lib/test/test_shutil.py
index e36cb9bf48..f90c37558f 100644
--- a/Lib/test/test_shutil.py
+++ b/Lib/test/test_shutil.py
@@ -1318,18 +1318,18 @@ class TestWhich(unittest.TestCase):
# that exists, it should be returned.
base_dir, tail_dir = os.path.split(self.dir)
relpath = os.path.join(tail_dir, self.file)
- with support.temp_cwd(path=base_dir):
+ with support.change_cwd(path=base_dir):
rv = shutil.which(relpath, path=self.temp_dir)
self.assertEqual(rv, relpath)
# But it shouldn't be searched in PATH directories (issue #16957).
- with support.temp_cwd(path=self.dir):
+ with support.change_cwd(path=self.dir):
rv = shutil.which(relpath, path=base_dir)
self.assertIsNone(rv)
def test_cwd(self):
# Issue #16957
base_dir = os.path.dirname(self.dir)
- with support.temp_cwd(path=self.dir):
+ with support.change_cwd(path=self.dir):
rv = shutil.which(self.file, path=base_dir)
if sys.platform == "win32":
# Windows: current directory implicitly on PATH
@@ -1350,7 +1350,7 @@ class TestWhich(unittest.TestCase):
def test_relative_path(self):
base_dir, tail_dir = os.path.split(self.dir)
- with support.temp_cwd(path=base_dir):
+ with support.change_cwd(path=base_dir):
rv = shutil.which(self.file, path=tail_dir)
self.assertEqual(rv, os.path.join(tail_dir, self.file))
@@ -1375,7 +1375,7 @@ class TestWhich(unittest.TestCase):
def test_empty_path(self):
base_dir = os.path.dirname(self.dir)
- with support.temp_cwd(path=self.dir), \
+ with support.change_cwd(path=self.dir), \
support.EnvironmentVarGuard() as env:
env['PATH'] = self.dir
rv = shutil.which(self.file, path='')