8000 Refuse handlers if the child watcher has no loop attached by vxgmichel · Pull Request #391 · python/asyncio · GitHub
[go: up one dir, main page]

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

Refuse handlers if the child watcher has no loop attached #391

Closed
wants to merge 7 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use assertWarnsRegex for test_set_loop_race_condition
  • Loading branch information
vinmic committed Sep 15, 2016
commit 256e71341e20cc533b71e847093c4865b4f5b1f5
6 changes: 2 additions & 4 deletions tests/test_unix_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -1397,11 +1397,9 @@ def test_set_loop_race_condition(self, m):
with mock.patch.object(
old_loop, "remove_signal_handler") as m_remove_signal_handler:

with warnings.catch_warnings(record=True) as warns:
with self.assertWarnsRegex(
RuntimeWarning, 'A loop is being detached'):
self.watcher.attach_loop(None)
self.assertEqual(len(warns), 1)
self.assertEqual(warns[0].category, RuntimeWarning)
self.assertIn('A loop is being detached', warns[0].message.args[0])

m_remove_signal_handler.assert_called_once_with(
signal.SIGCHLD)
Expand Down
0