diff options
author | Zac Medico <zmedico@gentoo.org> | 2011-12-16 14:37:37 -0800 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2011-12-16 14:37:37 -0800 |
commit | 9f84f1333bb1b6ee32083fba39da5ce616f2657c (patch) | |
tree | 998794c54e64f6223f7b461fa0cc774fdedd0e69 /pym/portage/tests/ebuild | |
parent | 071c65bb4abac3c251f335bde20e13368349c55d (diff) | |
download | portage-9f84f1333bb1b6ee32083fba39da5ce616f2657c.tar.gz portage-9f84f1333bb1b6ee32083fba39da5ce616f2657c.tar.bz2 portage-9f84f1333bb1b6ee32083fba39da5ce616f2657c.zip |
_test_pty_eof: use os.read, not array.fromfile
We have abandoned array.fromfile() due to bugs that exist in all known
versions of Python (including Python 2.7 and Python 3.2). See
PipeReaderArrayTestCase, for example.
Diffstat (limited to 'pym/portage/tests/ebuild')
-rw-r--r-- | pym/portage/tests/ebuild/test_pty_eof.py | 29 |
1 files changed, 2 insertions, 27 deletions
diff --git a/pym/portage/tests/ebuild/test_pty_eof.py b/pym/portage/tests/ebuild/test_pty_eof.py index 0b0bbdb35..fe218b6fa 100644 --- a/pym/portage/tests/ebuild/test_pty_eof.py +++ b/pym/portage/tests/ebuild/test_pty_eof.py @@ -1,14 +1,12 @@ # Copyright 2009-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -import platform - from portage.tests import TestCase from portage.util._pty import _can_test_pty_eof, _test_pty_eof -class PtyEofFdopenBufferedTestCase(TestCase): +class PtyEofTestCase(TestCase): - def testPtyEofFdopenBuffered(self): + def testPtyEof(self): if not _can_test_pty_eof(): skip_reason = "unsupported on this platform" @@ -23,29 +21,6 @@ class PtyEofFdopenBufferedTestCase(TestCase): # The result is only valid if openpty does not raise EnvironmentError. if _can_test_pty_eof(): try: - self.assertEqual(_test_pty_eof(fdopen_buffered=True), True) - except EnvironmentError: - pass - -class PtyEofFdopenUnBufferedTestCase(TestCase): - def testPtyEofFdopenUnBuffered(self): - # New development: It appears that array.fromfile() is usable - # with python3 as long as fdopen is called with a bufsize - # argument of 0. - - if not _can_test_pty_eof(): - skip_reason = "unsupported on this platform" - self.portage_skip = skip_reason - self.fail(skip_reason) - return - - if platform.python_implementation() == 'PyPy': - # https://bugs.pypy.org/issue956 - self.todo = True - - # The result is only valid if openpty does not raise EnvironmentError. - if _can_test_pty_eof(): - try: self.assertEqual(_test_pty_eof(), True) except EnvironmentError: pass |