diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2015-09-06 11:14:49 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2015-09-06 11:14:49 (GMT) |
commit | 5fbadb63ef2a3d7645396e1f11fe9303883c7e65 (patch) | |
tree | 75d288ce9278350ed4dd3730de0d822999e76340 /Lib/test/test_glob.py | |
parent | dcaf4ccf3f1d8040313f68b77424d39691389164 (diff) | |
parent | 2a23adf4405bcd903aabf445dd54867d95f494a1 (diff) | |
download | cpython-5fbadb63ef2a3d7645396e1f11fe9303883c7e65.zip cpython-5fbadb63ef2a3d7645396e1f11fe9303883c7e65.tar.gz cpython-5fbadb63ef2a3d7645396e1f11fe9303883c7e65.tar.bz2 |
Use support.change_cwd() in tests.
Diffstat (limited to 'Lib/test/test_glob.py')
-rw-r--r-- | Lib/test/test_glob.py | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/Lib/test/test_glob.py b/Lib/test/test_glob.py index 21b0153..926588e 100644 --- a/Lib/test/test_glob.py +++ b/Lib/test/test_glob.py @@ -242,9 +242,7 @@ class GlobTests(unittest.TestCase): ('a', 'bcd', 'EF'), ('a', 'bcd', 'efg'))) eq(self.rglob('a', '**', 'bcd'), self.joins(('a', 'bcd'))) - predir = os.path.abspath(os.curdir) - try: - os.chdir(self.tempdir) + with change_cwd(self.tempdir): join = os.path.join eq(glob.glob('**', recursive=True), [join(*i) for i in full]) eq(glob.glob(join('**', ''), recursive=True), @@ -256,8 +254,6 @@ class GlobTests(unittest.TestCase): if can_symlink(): expect += [join('sym3', 'EF')] eq(glob.glob(join('**', 'EF'), recursive=True), expect) - finally: - os.chdir(predir) @skip_unless_symlink |