Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix unittests and add max supported pytest version #148

Merged
merged 4 commits into from Mar 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions setup.py
Expand Up @@ -40,13 +40,13 @@ def find_version():
"Framework :: Pytest",
],
python_requires=">= 3.5",
install_requires=["pytest >= 3.6.0"],
install_requires=["pytest >= 3.6.0, < 5.4.0"],
extras_require={
':python_version == "3.5"': "async_generator >= 1.3",
"testing": [
"coverage",
"async_generator >= 1.3",
"hypothesis >= 3.64",
"hypothesis >= 5.7.1",
],
},
entry_points={"pytest11": ["asyncio = pytest_asyncio.plugin"]},
Expand Down
6 changes: 6 additions & 0 deletions tests/test_hypothesis_integration.py
Expand Up @@ -8,6 +8,12 @@
from hypothesis import given, strategies as st


@pytest.fixture(scope="module")
def event_loop():
loop = asyncio.get_event_loop()
yield loop


@given(st.integers())
@pytest.mark.asyncio
async def test_mark_inner(n):
Expand Down
11 changes: 11 additions & 0 deletions tests/test_subprocess.py
Expand Up @@ -6,6 +6,17 @@
import pytest


if sys.platform == 'win32':
# The default asyncio event loop implementation on Windows does not
# support subprocesses. Subprocesses are available for Windows if a
# ProactorEventLoop is used.
@pytest.yield_fixture()
def event_loop():
loop = asyncio.ProactorEventLoop()
yield loop
loop.close()


@pytest.mark.asyncio(forbid_global_loop=False)
async def test_subprocess(event_loop):
"""Starting a subprocess should be possible."""
Expand Down