Skip to content

Commit

Permalink
Skip uvloop tests whenever it's not installed
Browse files Browse the repository at this point in the history
  • Loading branch information
agronholm committed Mar 30, 2022
1 parent 94bc7f3 commit 62cd9ef
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions tests/test_runner.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import asyncio
import logging
import platform
import sys
from concurrent.futures import ThreadPoolExecutor
from unittest.mock import patch
Expand Down Expand Up @@ -94,14 +93,9 @@ def test_run_max_threads(event_loop, max_threads):
assert not mock_executor.called


@pytest.mark.skipif(
platform.python_implementation() != "CPython", reason="uvloop only works on CPython"
)
@pytest.mark.skipif(
platform.system() == "Windows", reason="uvloop does not work on Windows"
)
def test_uvloop_policy(caplog):
"""Test that the runner switches to a different event loop policy when instructed to."""
pytest.importorskip("uvloop", reason="uvloop not installed")
caplog.set_level(logging.INFO)
component = ShutdownComponent()
old_policy = asyncio.get_event_loop_policy()
Expand Down

0 comments on commit 62cd9ef

Please sign in to comment.