diff options
Diffstat (limited to 'pym/portage/tests/ebuild/test_pty_eof.py')
-rw-r--r-- | pym/portage/tests/ebuild/test_pty_eof.py | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/pym/portage/tests/ebuild/test_pty_eof.py b/pym/portage/tests/ebuild/test_pty_eof.py index 042227b67..c4386e944 100644 --- a/pym/portage/tests/ebuild/test_pty_eof.py +++ b/pym/portage/tests/ebuild/test_pty_eof.py @@ -1,4 +1,4 @@ -# Copyright 2009-2010 Gentoo Foundation +# Copyright 2009-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 from portage.tests import TestCase @@ -6,7 +6,7 @@ from portage.util._pty import _can_test_pty_eof, _test_pty_eof class PtyEofTestCase(TestCase): - def testPtyEof(self): + def testPtyEofFdopenBuffered(self): # This tests if the following python issue is fixed yet: # http://bugs.python.org/issue5380 # Since it might not be fixed, mark as todo. @@ -17,3 +17,15 @@ class PtyEofTestCase(TestCase): self.assertEqual(_test_pty_eof(), True) except EnvironmentError: pass + + 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. + + # The result is only valid if openpty does not raise EnvironmentError. + if _can_test_pty_eof(): + try: + self.assertEqual(_test_pty_eof(fdopen_buffered=False), True) + except EnvironmentError: + pass |