python/tests: clean up generated files if successful

This commit is contained in:
Cosimo Lupo 2016-04-10 20:51:10 +01:00
parent a8d1bf5266
commit f66c7c5442
3 changed files with 14 additions and 1 deletions

View File

@ -24,4 +24,7 @@ for filename in glob.glob("testdata/*.compressed*"):
env=TEST_ENV)
if diff_q(uncompressed, expected) != 0:
sys.exit(1)
os.unlink(uncompressed)
try:
os.unlink(uncompressed)
except OSError:
pass

View File

@ -34,3 +34,8 @@ for filename in INPUTS.splitlines():
uncompressed, "--custom-dictionary", filename], env=TEST_ENV)
if diff_q(filename, uncompressed) != 0:
sys.exit(1)
try:
os.unlink(compressed)
os.unlink(uncompressed)
except OSError:
pass

View File

@ -41,3 +41,8 @@ for filename in INPUTS.splitlines():
env=TEST_ENV)
if diff_q(filename, uncompressed) != 0:
sys.exit(1)
try:
os.unlink(compressed)
os.unlink(uncompressed)
except OSError:
pass