tests: Make io test cleanup after itself by removing 'testfile'.
This commit is contained in:
parent
22ff397fb1
commit
d292a81e95
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue