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

pull/1423/merge
Damien George 2015-08-21 08:45:52 +01:00
rodzic 22ff397fb1
commit d292a81e95
1 zmienionych plików z 7 dodań i 0 usunięć

Wyświetl plik

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