From f66c7c5442a9d50ce775a5469b25d936b5726626 Mon Sep 17 00:00:00 2001 From: Cosimo Lupo Date: Sun, 10 Apr 2016 20:51:10 +0100 Subject: python/tests: clean up generated files if successful --- python/tests/compatibility_test.py | 5 ++++- python/tests/custom_dictionary_test.py | 5 +++++ python/tests/roundtrip_test.py | 5 +++++ 3 files changed, 14 insertions(+), 1 deletion(-) (limited to 'python') 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 -- cgit v1.1