Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

gh-81002: Add tests for termios #110386

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Oct 10, 2023
Merged
Prev Previous commit
Next Next commit
Re-open files for every test.
  • Loading branch information
serhiy-storchaka committed Oct 6, 2023
commit 55d373548f2f872c7169455e61af115ad88bd496
13 changes: 6 additions & 7 deletions 13 Lib/test/test_termios.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@
@unittest.skipUnless(hasattr(os, 'openpty'), "need os.openpty()")
class TestFunctions(unittest.TestCase):

@classmethod
def setUpClass(cls):
cls.master_fd, cls.fd = os.openpty()
cls.addClassCleanup(os.close, cls.master_fd)
cls.stream = cls.enterClassContext(open(cls.fd, 'wb', buffering=0))
tmp = cls.enterClassContext(tempfile.TemporaryFile(mode='wb', buffering=0))
cls.bad_fd = tmp.fileno()
def setUp(self):
master_fd, self.fd = os.openpty()
self.addCleanup(os.close, master_fd)
self.stream = self.enterContext(open(self.fd, 'wb', buffering=0))
tmp = self.enterContext(tempfile.TemporaryFile(mode='wb', buffering=0))
self.bad_fd = tmp.fileno()

def assertRaisesTermiosError(self, errno, callable, *args):
with self.assertRaises(termios.error) as cm:
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.