Skip to content

Commit

Permalink
test:allow slower asyncio if platform=="darwin"
Browse files Browse the repository at this point in the history
  • Loading branch information
casperdcl committed Dec 20, 2020
1 parent 8c55759 commit ea7889a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/py37_asyncio.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from functools import partial
from time import time
from sys import platform
import asyncio

from pytest import mark
Expand Down Expand Up @@ -96,7 +97,8 @@ async def test_coroutines():


@mark.asyncio
async def test_as_completed(capsys):
@mark.parametrize("tol", [0.2 if platform.startswith("darwin") else 0.1])
async def test_as_completed(capsys, tol):
"""Test asyncio as_completed"""
for retry in range(3):
t = time()
Expand All @@ -105,7 +107,7 @@ async def test_as_completed(capsys):
await i
t = time() - t - 2 * skew
try:
assert 0.27 < t < 0.33, t
assert 0.3 * (1 - tol) < t < 0.3 * (1 + tol), t
_, err = capsys.readouterr()
assert '30/30' in err
except AssertionError:
Expand Down

0 comments on commit ea7889a

Please sign in to comment.