test_pty_eof: add SKIP msg for unsupported plat
authorZac Medico <zmedico@gentoo.org>
Sun, 4 Sep 2011 19:05:48 +0000 (12:05 -0700)
committerZac Medico <zmedico@gentoo.org>
Sun, 4 Sep 2011 19:05:48 +0000 (12:05 -0700)
pym/portage/tests/ebuild/test_pty_eof.py

index 4b6ff21d05d2165056b36fefc14c63a0299c7fbb..c8de3e2a70066e36a34e47eb4a316a35bee1092e 100644 (file)
@@ -7,6 +7,13 @@ from portage.util._pty import _can_test_pty_eof, _test_pty_eof
 class PtyEofFdopenBufferedTestCase(TestCase):
 
        def testPtyEofFdopenBuffered(self):
+
+               if not _can_test_pty_eof():
+                       skip_reason = "unsupported on this platform"
+                       self.portage_skip = skip_reason
+                       self.fail(skip_reason)
+                       return
+
                # This tests if the following python issue is fixed yet:
                #   http://bugs.python.org/issue5380
                # Since it might not be fixed, mark as todo.
@@ -24,6 +31,12 @@ class PtyEofFdopenUnBufferedTestCase(TestCase):
                # 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
+
                # The result is only valid if openpty does not raise EnvironmentError.
                if _can_test_pty_eof():
                        try: