Use support.change_cwd() in tests.

This commit is contained in:
Serhiy Storchaka 2015-09-06 14:14:49 +03:00
commit 5fbadb63ef
9 changed files with 34 additions and 104 deletions

View file

@ -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