From d292a81e95bd558f3902f88fa4d6d5641a4aa388 Mon Sep 17 00:00:00 2001 From: Damien George Date: Fri, 21 Aug 2015 08:45:52 +0100 Subject: [PATCH] tests: Make io test cleanup after itself by removing 'testfile'. --- tests/io/open_append.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/io/open_append.py b/tests/io/open_append.py index fb76d09c42..da420a16ea 100644 --- a/tests/io/open_append.py +++ b/tests/io/open_append.py @@ -8,6 +8,7 @@ if not hasattr(os, "unlink"): print("SKIP") sys.exit() +# cleanup in case testfile exists try: os.unlink("testfile") except OSError: @@ -29,3 +30,9 @@ f.close() f = open("testfile") print(f.read()) f.close() + +# cleanup +try: + os.unlink("testfile") +except OSError: + pass