diff --git a/pytest.ini b/pytest.ini index 3ba19fe1..57bc2a86 100644 --- a/pytest.ini +++ b/pytest.ini @@ -3,3 +3,4 @@ filterwarnings = error ignore::UserWarning +asyncio_mode=auto \ No newline at end of file diff --git a/test-requirements.txt b/test-requirements.txt index c16fac10..8dbe3a6a 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,6 +1,7 @@ flake8==4.0.1 pytest==6.2.5 -pytest-asyncio==0.16.0 +pytest-asyncio==0.16.0;python_version<"3.7" +pytest-asyncio==0.17.0;python_version>="3.7" pytest-cov==3.0.0 pytest-httpserver==1.0.3 pytest-rerunfailures==10.2 diff --git a/tests/test_executors.py b/tests/test_executors.py index 886d8870..1b25df27 100644 --- a/tests/test_executors.py +++ b/tests/test_executors.py @@ -63,7 +63,10 @@ async def test_asyncio_progressbar_queue_executor(): assert executor.execution_time < 0.5 executor = AsyncioProgressbarQueueExecutor(logger=logger, in_parallel=5) - assert await executor.run(tasks) == [0, 3, 6, 1, 4, 7, 9, 2, 5, 8] + assert await executor.run(tasks) in ( + [0, 3, 6, 1, 4, 7, 9, 2, 5, 8], + [0, 3, 6, 1, 4, 9, 7, 2, 5, 8], + ) assert executor.execution_time > 0.3 assert executor.execution_time < 0.4