Move the check for openpty to the beginning.
This commit is contained in:
parent
59ba4299d0
commit
7d00099021
|
@ -3,13 +3,13 @@
|
||||||
import os, unittest
|
import os, unittest
|
||||||
from test.test_support import run_unittest, TestSkipped
|
from test.test_support import run_unittest, TestSkipped
|
||||||
|
|
||||||
class OpenptyTest(unittest.TestCase):
|
if not hasattr(os, "openpty"):
|
||||||
def test(self):
|
|
||||||
try:
|
|
||||||
master, slave = os.openpty()
|
|
||||||
except AttributeError:
|
|
||||||
raise TestSkipped, "No openpty() available."
|
raise TestSkipped, "No openpty() available."
|
||||||
|
|
||||||
|
|
||||||
|
class OpenptyTest(unittest.TestCase):
|
||||||
|
def test(self):
|
||||||
|
master, slave = os.openpty()
|
||||||
if not os.isatty(slave):
|
if not os.isatty(slave):
|
||||||
self.fail("Slave-end of pty is not a terminal.")
|
self.fail("Slave-end of pty is not a terminal.")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue