aboutsummaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorCosimo Lupo <cosimo.lupo@daltonmaag.com>2016-04-10 20:51:10 +0100
committerCosimo Lupo <cosimo.lupo@daltonmaag.com>2016-04-10 20:52:27 +0100
commitf66c7c5442a9d50ce775a5469b25d936b5726626 (patch)
tree183ef6e0372a1b27bfe36f40418e56fbede6838a /python
parenta8d1bf5266b857a2faccb2c97227516858c8f75c (diff)
downloadbrotli-f66c7c5442a9d50ce775a5469b25d936b5726626.zip
brotli-f66c7c5442a9d50ce775a5469b25d936b5726626.tar.gz
brotli-f66c7c5442a9d50ce775a5469b25d936b5726626.tar.bz2
python/tests: clean up generated files if successful
Diffstat (limited to 'python')
-rwxr-xr-xpython/tests/compatibility_test.py5
-rw-r--r--python/tests/custom_dictionary_test.py5
-rwxr-xr-xpython/tests/roundtrip_test.py5
3 files changed, 14 insertions, 1 deletions
diff --git a/python/tests/compatibility_test.py b/python/tests/compatibility_test.py
index 668c9ec..b6dbf77 100755
--- a/python/tests/compatibility_test.py
+++ b/python/tests/compatibility_test.py
@@ -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
diff --git a/python/tests/custom_dictionary_test.py b/python/tests/custom_dictionary_test.py
index afbf07a..34a44bd 100644
--- a/python/tests/custom_dictionary_test.py
+++ b/python/tests/custom_dictionary_test.py
@@ -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
diff --git a/python/tests/roundtrip_test.py b/python/tests/roundtrip_test.py
index 719a7b7..02c784d 100755
--- a/python/tests/roundtrip_test.py
+++ b/python/tests/roundtrip_test.py
@@ -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