Change back to old working directory after changing it for tests.
This commit is contained in:
parent
c329208910
commit
83f355634b
|
@ -44,12 +44,13 @@ class ArchiveTest (unittest.TestCase):
|
||||||
archive = os.path.join(datadir, filename)
|
archive = os.path.join(datadir, filename)
|
||||||
# create a temporary directory for extraction
|
# create a temporary directory for extraction
|
||||||
tmpdir = patoolib.util.tmpdir(dir=basedir)
|
tmpdir = patoolib.util.tmpdir(dir=basedir)
|
||||||
|
olddir = os.getcwd()
|
||||||
os.chdir(tmpdir)
|
os.chdir(tmpdir)
|
||||||
try:
|
try:
|
||||||
patoolib._handle_archive(archive, 'extract', program=self.program)
|
patoolib._handle_archive(archive, 'extract', program=self.program)
|
||||||
patoolib._handle_archive(archive, 'extract', program=self.program, verbose=True)
|
patoolib._handle_archive(archive, 'extract', program=self.program, verbose=True)
|
||||||
finally:
|
finally:
|
||||||
os.chdir(basedir)
|
os.chdir(olddir)
|
||||||
shutil.rmtree(tmpdir)
|
shutil.rmtree(tmpdir)
|
||||||
|
|
||||||
def archive_list (self, filename):
|
def archive_list (self, filename):
|
||||||
|
|
Loading…
Reference in New Issue