summaryrefslogtreecommitdiffstats
path: root/tests/test_gio.py
diff options
context:
space:
mode:
authorJohan Dahlin <johan@src.gnome.org>2008-01-20 15:49:52 +0000
committerJohan Dahlin <johan@src.gnome.org>2008-01-20 15:49:52 +0000
commit3d0d2b4d1683606b03ddcae727349c055d28d2d9 (patch)
tree08a0283d3de21dd26ecf149a70e98911cb683f62 /tests/test_gio.py
parent702ed9b73e4f596aadf86cdfbf3655cee97b4cb6 (diff)
downloadpygobject-3d0d2b4d1683606b03ddcae727349c055d28d2d9.tar.gz
pygobject-3d0d2b4d1683606b03ddcae727349c055d28d2d9.tar.xz
pygobject-3d0d2b4d1683606b03ddcae727349c055d28d2d9.zip
Reuse file descriptor for reading and writing. Avoid unnecessary flush()
svn path=/trunk/; revision=742
Diffstat (limited to 'tests/test_gio.py')
-rw-r--r--tests/test_gio.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/tests/test_gio.py b/tests/test_gio.py
index 092a8ec..1b8c5fe 100644
--- a/tests/test_gio.py
+++ b/tests/test_gio.py
@@ -8,10 +8,9 @@ from common import gio, gobject
class TestInputStream(unittest.TestCase):
def setUp(self):
- f = open("inputstream.txt", "w")
- f.write("testing")
-
- self._f = open("inputstream.txt", "r")
+ self._f = open("inputstream.txt", "w+")
+ self._f.write("testing")
+ self._f.seek(0)
self.stream = gio.unix.InputStream(self._f.fileno(), False)
def tearDown(self):
@@ -57,7 +56,6 @@ class TestOutputStream(unittest.TestCase):
def setUp(self):
self._f = open("outputstream.txt", "w")
self.stream = gio.unix.OutputStream(self._f.fileno(), False)
- self._f.flush()
def tearDown(self):
self._f.close()