mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Issue #16488: epoll() objects now support the with
statement.
Patch by Serhiy Storchaka.
This commit is contained in:
parent
c48e81ed46
commit
09bb89b8cf
4 changed files with 36 additions and 1 deletions
|
@ -87,6 +87,13 @@ class TestEPoll(unittest.TestCase):
|
|||
self.assertRaises(TypeError, select.epoll, ['foo'])
|
||||
self.assertRaises(TypeError, select.epoll, {})
|
||||
|
||||
def test_context_manager(self):
|
||||
with select.epoll(16) as ep:
|
||||
self.assertGreater(ep.fileno(), 0)
|
||||
self.assertFalse(ep.closed)
|
||||
self.assertTrue(ep.closed)
|
||||
self.assertRaises(ValueError, ep.fileno)
|
||||
|
||||
def test_add(self):
|
||||
server, client = self._connected_pair()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue