tests: Make io test cleanup after itself by removing 'testfile'.

This commit is contained in:
Damien George 2015-08-21 08:45:52 +01:00
parent 22ff397fb1
commit d292a81e95
1 changed files with 7 additions and 0 deletions

View File

@ -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