Author: Armin Rigo <ar...@tunes.org> Branch: Changeset: r83664:57d144629ace Date: 2016-04-14 09:34 +0200 http://bitbucket.org/pypy/pypy/changeset/57d144629ace/
Log: Improve test_seek, and try to make it not fail on windows. Failed on that: now it just silently ends py.test. No clue. diff --git a/rpython/rlib/test/test_rfile.py b/rpython/rlib/test/test_rfile.py --- a/rpython/rlib/test/test_rfile.py +++ b/rpython/rlib/test/test_rfile.py @@ -267,19 +267,28 @@ self.interpret(f, []) def test_seek(self): + from sys import platform fname = str(self.tmpdir.join('file_4')) def f(): f = open(fname, "w+") - f.write("xxx") + f.write("abcdef") f.seek(0) - assert f.read() == "xxx" + assert f.read() == "abcdef" + f.seek(1) + assert f.read() == "bcdef" + f.seek(2) + f.seek(-2, 2) + assert f.read() == "ef" + f.seek(2) + f.seek(-1, 1) + assert f.read() == "bcdef" try: f.seek(0, 42) except IOError as e: assert e.errno == errno.EINVAL else: - assert False + assert platform == 'win32' f.close() f() _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit