MCPcopy Index your code
hub / github.com/python/cpython / test_register_file

Method test_register_file

Lib/test/test_selectors.py:560–568  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

558 SELECTOR = getattr(selectors, 'EpollSelector', None)
559
560 def test_register_file(self):
561 # epoll(7) returns EPERM when given a file to watch
562 s = self.SELECTOR()
563 with tempfile.NamedTemporaryFile() as f:
564 with self.assertRaises(IOError):
565 s.register(f, selectors.EVENT_READ)
566 # the SelectorKey has been removed
567 with self.assertRaises(KeyError):
568 s.get_key(f)
569
570
571@unittest.skipUnless(hasattr(selectors, 'KqueueSelector'),

Callers

nothing calls this directly

Calls 3

get_keyMethod · 0.80
assertRaisesMethod · 0.45
registerMethod · 0.45

Tested by

no test coverage detected