Skip to content
This repository was archived by the owner on Nov 23, 2017. It is now read-only.

Commit 99148c2

Browse files
author
vinmic
committed
Add test_add_child_handler_with_no_loop_attached
1 parent 256e713 commit 99148c2

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/test_unix_events.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1471,6 +1471,15 @@ def test_close(self, m):
14711471
if isinstance(self.watcher, asyncio.FastChildWatcher):
14721472
self.assertFalse(self.watcher._zombies)
14731473

1474+
@waitpid_mocks
1475+
def test_add_child_handler_with_no_loop_attached(self, m):
1476+
callback = mock.Mock()
1477+
with self.create_watcher() as watcher:
1478+
with self.assertRaisesRegex(
1479+
RuntimeError,
1480+
'the child watcher does not have a loop attached'):
1481+
watcher.add_child_handler(100, callback)
1482+
14741483

14751484
class SafeChildWatcherTests (ChildWatcherTestsMixin, test_utils.TestCase):
14761485
def create_watcher(self):

0 commit comments

Comments
 (0)