diff --git a/tests/test_service.py b/tests/test_service.py index da8d9f4..a15789c 100644 --- a/tests/test_service.py +++ b/tests/test_service.py @@ -6,6 +6,7 @@ class TestService: + @pytest.mark.asyncio @pytest.mark.parametrize( ('rate_limit', 'period'), ((1, 0.5), (3, 1.0), (100, 1.5)) ) @@ -19,6 +20,7 @@ async def request(value: float): main = asyncio.gather(*[request(v) for v in range(int(rate_limit / period) + 100)]) asyncio.get_event_loop().run_until_complete(main) + @pytest.mark.asyncio @pytest.mark.parametrize( ('max_simultaneous',), ((1,), (3,), (100,)) ) diff --git a/tests/test_throttler.py b/tests/test_throttler.py index 3e33d3b..16bb540 100644 --- a/tests/test_throttler.py +++ b/tests/test_throttler.py @@ -16,6 +16,7 @@ def test_exceptions(self, rate_limit: int, period: float): with pytest.raises(ValueError): Throttler(rate_limit, period) + @pytest.mark.asyncio @pytest.mark.parametrize( ('rate_limit', 'period', 'count'), tuple(product((1, 3, 5), (0.5, 1.0, 1.5), (3, 5, 7))) + diff --git a/tests/test_throttler_simultaneous.py b/tests/test_throttler_simultaneous.py index 103db6d..ad18bc3 100644 --- a/tests/test_throttler_simultaneous.py +++ b/tests/test_throttler_simultaneous.py @@ -7,6 +7,7 @@ class TestThrottlerSimultaneous: + @pytest.mark.asyncio @pytest.mark.parametrize( ('max_simultaneous', 'count'), ((1, 10), (3, 10), (100, 500)) )