Skip to content

Commit 973eaa4

Browse files
committed
[test] Remove pytest-trio from test dependencies.
trio v0.22 deprecated trio.MultiError. This adjustment requires at least pytest-trio v0.8.0, [0] which, in turn, depends on pytest>=7.2. Pytest-asyncio currently supports pytest>=7.0. Therefore, we either need to juggle with the constraints in the pytest-min test environment or remove the pytest-trio dependency entirely. I opted for the latter. Pytest-asyncio should be compatible with other plugins, but it should not be responsible to test that compatibility. If every pytest plugin wrote tests against other plugins, we ended up in dependency hell and a lot of work would be done multiple times. There's a dedicated section in pytest for testing plugin integration. This is the right place to do it. [0] https://pytest-trio.readthedocs.io/en/v0.8.0/history.html#misc Signed-off-by: Michael Seifert <[email protected]>
1 parent e55317a commit 973eaa4

File tree

6 files changed

+65
-55
lines changed

6 files changed

+65
-55
lines changed

dependencies/default/constraints.txt

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,14 @@
1-
async-generator==1.10
21
attrs==23.1.0
32
coverage==7.3.2
43
exceptiongroup==1.1.3
54
flaky==3.7.0
65
hypothesis==6.88.3
7-
idna==3.4
8-
importlib-metadata==6.8.0
96
iniconfig==2.0.0
107
mypy==1.6.1
118
mypy-extensions==1.0.0
12-
outcome==1.3.0.post0
139
packaging==23.2
1410
pluggy==1.3.0
15-
pyparsing==3.1.1
1611
pytest==7.4.3
17-
pytest-trio==0.8.0
18-
sniffio==1.3.0
1912
sortedcontainers==2.4.0
2013
tomli==2.0.1
21-
trio==0.23.1
22-
typed-ast==1.5.5
23-
zipp==3.17.0
14+
typing_extensions==4.8.0
Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,26 @@
1-
argcomplete==2.0.0
2-
attrs==22.1.0
3-
certifi==2022.9.24
4-
charset-normalizer==2.1.1
5-
elementpath==3.0.2
6-
exceptiongroup==1.0.0rc9
7-
hypothesis==6.56.3
1+
argcomplete==3.1.2
2+
attrs==23.1.0
3+
certifi==2023.7.22
4+
charset-normalizer==3.3.1
5+
coverage==7.3.2
6+
elementpath==4.1.5
7+
exceptiongroup==1.1.3
8+
flaky==3.7.0
9+
hypothesis==6.88.3
810
idna==3.4
9-
iniconfig==1.1.1
10-
mock==4.0.3
11+
iniconfig==2.0.0
12+
mock==5.1.0
13+
mypy==1.6.1
14+
mypy-extensions==1.0.0
1115
nose==1.3.7
12-
packaging==21.3
13-
pluggy==1.0.0
16+
packaging==23.2
17+
pluggy==1.3.0
1418
py==1.11.0
15-
Pygments==2.13.0
16-
pyparsing==3.0.9
19+
Pygments==2.16.1
1720
pytest==7.0.0
18-
requests==2.28.1
21+
requests==2.31.0
1922
sortedcontainers==2.4.0
2023
tomli==2.0.1
21-
trio==0.21.0
22-
urllib3==1.26.12
23-
xmlschema==2.1.1
24+
typing_extensions==4.8.0
25+
urllib3==2.0.7
26+
xmlschema==2.5.0

docs/source/reference/changelog.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
Changelog
33
=========
44

5-
0.22.1 (UNRELEASED)
5+
0.23.0 (UNRELEASED)
66
===================
7-
- Fixes a bug that broke compatibility with pytest>=7.0,<7.2. `#654 <https://github.com/pytest-dev/pytest-asyncio/pull/654>`_
7+
- Removes pytest-trio from the test dependencies `#620 <https://github.com/pytest-dev/pytest-asyncio/pull/620>`_
88

99
0.22.0 (2023-10-31)
1010
===================

setup.cfg

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ testing =
4848
hypothesis >= 5.7.1
4949
flaky >= 3.5.0
5050
mypy >= 0.931
51-
pytest-trio >= 0.7.0
5251
docs =
5352
sphinx >= 5.3
5453
sphinx-rtd-theme >= 1.0

tests/modes/test_strict_mode.py

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,45 @@ async def test_a(self, fixture_a):
6666
)
6767
result = testdir.runpytest("--asyncio-mode=auto")
6868
result.assert_outcomes(passed=1)
69+
70+
71+
def test_strict_mode_ignores_unmarked_coroutine(testdir):
72+
testdir.makepyfile(
73+
dedent(
74+
"""\
75+
import pytest
76+
77+
async def test_anything():
78+
pass
79+
"""
80+
)
81+
)
82+
result = testdir.runpytest("--asyncio-mode=strict", "-W default")
83+
result.assert_outcomes(skipped=1, warnings=1)
84+
result.stdout.fnmatch_lines(["*async def functions are not natively supported*"])
85+
86+
87+
def test_strict_mode_ignores_unmarked_fixture(testdir):
88+
testdir.makepyfile(
89+
dedent(
90+
"""\
91+
import pytest
92+
93+
# Not using pytest_asyncio.fixture
94+
@pytest.fixture()
95+
async def any_fixture():
96+
raise RuntimeError()
97+
98+
async def test_anything(any_fixture):
99+
pass
100+
"""
101+
)
102+
)
103+
result = testdir.runpytest("--asyncio-mode=strict", "-W default")
104+
result.assert_outcomes(skipped=1, warnings=2)
105+
result.stdout.fnmatch_lines(
106+
[
107+
"*async def functions are not natively supported*",
108+
"*coroutine 'any_fixture' was never awaited*",
109+
],
110+
)

tests/trio/test_fixtures.py

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)