Author: Manuel Jacob <m...@manueljacob.de> Branch: py3k Changeset: r79918:4d306d6f722e Date: 2015-10-01 14:54 +0200 http://bitbucket.org/pypy/pypy/changeset/4d306d6f722e/
Log: Remove this test because it doesn't make sense anymore. In the default branch (implementing 2.7), the test checks that, even though the script first writes to sys.stdout, stderr is output first. This works because both streams are buffered and, at interpreter shutdown, sys.stderr is flushed first. The order in which sys.stdout and sys.stderr are flushed isn't determistic if running on Python 3.x. Because of this, the test was changed in the py3k branch (at the time trying to implement Python 3.2) to check that both streams are always line buffered. However this assumption is false. Since Python 3.0 sys.stdout and sys.stderr are line buffered by default iff connected to a TTY or set otherwise unbuffered. diff --git a/pypy/interpreter/test/test_app_main.py b/pypy/interpreter/test/test_app_main.py --- a/pypy/interpreter/test/test_app_main.py +++ b/pypy/interpreter/test/test_app_main.py @@ -808,31 +808,6 @@ data = self.run('-S -i', expect_prompt=True, expect_banner=True) assert 'copyright' not in data - def test_non_interactive_stdout_fully_buffered(self): - if os.name == 'nt': - try: - import __pypy__ - except: - py.test.skip('app_main cannot run on non-pypy for windows') - path = getscript(r""" - import sys, time - sys.stdout.write('\x00(STDOUT)\n\x00') # stays in buffers - time.sleep(1) - sys.stderr.write('\x00[STDERR]\n\x00') - time.sleep(1) - # stdout flushed automatically here - """) - cmdline = '%s -u "%s" %s' % (python3, app_main, path) - print 'POPEN:', cmdline - child_in, child_out_err = os.popen4(cmdline) - data = child_out_err.read(11) - # Py3 is always at least line buffered - assert data == '\x00(STDOUT)\n\x00' # from stdout - child_in.close() - data = child_out_err.read(11) - assert data == '\x00[STDERR]\n\x00' # from stderr - child_out_err.close() - def test_non_interactive_stdout_unbuffered(self, monkeypatch): monkeypatch.setenv('PYTHONUNBUFFERED', '1') if os.name == 'nt': _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit