From 6ea818395e720d669a54c59e4da295836a3ae488 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=2E=20K=C3=A4rkk=C3=A4inen?= Date: Wed, 18 Mar 2020 17:01:18 +0200 Subject: [PATCH] Disable testing of a function N/A on Windows. --- tests/test_signal_handlers.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/test_signal_handlers.py b/tests/test_signal_handlers.py index 262f41cb..ebf069d8 100644 --- a/tests/test_signal_handlers.py +++ b/tests/test_signal_handlers.py @@ -1,4 +1,6 @@ import asyncio +import os +import signal from queue import Queue from unittest.mock import MagicMock @@ -16,11 +18,16 @@ calledq = Queue() def set_loop(app, loop): - loop.add_signal_handler = MagicMock() + global mock + mock = MagicMock() + if os.name == "nt": + signal.signal = mock + else: + loop.add_signal_handler = mock def after(app, loop): - calledq.put(loop.add_signal_handler.called) + calledq.put(mock.called) def test_register_system_signals(app):