Commit a06c38b4 authored by Paul Sokolovsky's avatar Paul Sokolovsky
Browse files

tests: Add testcase for open(..., "a").

parent 63b9e598
import sys
try:
import _os as os
except ImportError:
import os
if not hasattr(os, "unlink"):
print("SKIP")
sys.exit()
try:
os.unlink("testfile")
except OSError:
pass
# Should create a file
f = open("testfile", "a")
f.write("foo")
f.close()
f = open("testfile")
print(f.read())
f.close()
f = open("testfile", "a")
f.write("bar")
f.close()
f = open("testfile")
print(f.read())
f.close()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment