diff --git a/tests/conftest.py b/tests/conftest.py index a95165e..6a9f938 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -8,9 +8,6 @@ import random import signal import platform import time -import enum - -from typing import Optional import pytest import tractor @@ -77,21 +74,11 @@ def spawn_backend(request): return request.config.option.spawn_backend -class CIEnvoirment(enum.Enum): - Travis = 'TRAVIS' - Github = 'GITHUB' - - @pytest.fixture(scope='session') -def ci_env() -> Optional[CIEnvoirment]: +def ci_env() -> bool: """Detect CI envoirment. """ - if os.environ.get('TRAVIS'): - return CIEnvoirment.Travis - elif os.environ.get('CI'): - return CIEnvoirment.Github - else: - return None + return os.environ.get('TRAVIS', False) or os.environ.get('CI', False) @pytest.fixture(scope='session') diff --git a/tests/test_streaming.py b/tests/test_streaming.py index 243ac30..531352a 100644 --- a/tests/test_streaming.py +++ b/tests/test_streaming.py @@ -9,8 +9,6 @@ import trio import tractor import pytest -from conftest import CIEnvoirment - def test_must_define_ctx(): @@ -205,12 +203,11 @@ async def cancel_after(wait): @pytest.fixture(scope='module') def time_quad_ex(arb_addr, ci_env, spawn_backend): - if ci_env in (CIEnvoirment.Github, CIEnvoirment.Travis): - if spawn_backend == 'mp' and (platform.system() != 'Windows'): - """no idea, but the travis and github actions, mp *nix runs are - flaking out here often - """ - pytest.skip("Test is too flaky on mp in CI") + if ci_env and spawn_backend == 'mp' and (platform.system() != 'Windows'): + """no idea, but the travis and github actions, mp *nix runs are + flaking out here often + """ + pytest.skip("Test is too flaky on mp in CI") timeout = 7 if platform.system() in ('Windows', 'Darwin') else 4 start = time.time()