Skip to content
Merged
Prev Previous commit
Next Next commit
Skip tests if /dev/tty is not available.
  • Loading branch information
serhiy-storchaka committed Oct 5, 2023
commit 01fc9b58b3230b65ce668adc8dd264f7f5689783
5 changes: 4 additions & 1 deletion Lib/test/test_termios.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
class TestFunctions(unittest.TestCase):

def setUp(self):
self.stream = open('/dev/tty', 'wb', buffering=0)
try:
self.stream = open('/dev/tty', 'wb', buffering=0)
except OSError:
self.skipTest("Cannot open '/dev/tty'")
self.addCleanup(self.stream.close)
self.fd = self.stream.fileno()
self.bad_fd, _ = tempfile.mkstemp()
Expand Down