8000 Fixed pytest plugin test · IBMZ-Linux-OSS-Python/anyio@142c485 · GitHub
[go: up one dir, main page]

Skip to content

Commit 142c485

Browse files
committed
Fixed pytest plugin test
1 parent 5b311a1 commit 142c485

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

tests/test_pytest_plugin.py

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -425,19 +425,6 @@ async def test_anyio_mark_last_fail(x):
425425
def test_lock_backend(
426426
backend_name: str, testdir: Pytester, monkeypatch: MonkeyPatch
427427
) -> None:
428-
testdir.makeconftest(
429-
f"""
430-
import os
431-
import sys
432-
433-
pytest_plugins = ["anyio"]
434-
435-
os.environ["ANYIO_BACKEND"] = "{backend_name}"
436-
del sys.modules['anyio._core._eventloop']
437-
del sys.modules['anyio.pytest_plugin']
438-
del sys.modules['anyio']
439-
"""
440-
)
441428
testdir.makepyfile(
442429
f"""
443430
import os
@@ -455,5 +442,6 @@ async def test_sleep(anyio_backend_name):
455442
"""
456443
)
457444

458-
result = testdir.runpytest("-p", "no:anyio")
445+
monkeypatch.setenv("ANYIO_BACKEND", backend_name)
446+
result = testdir.runpytest_subprocess(*pytest_args)
459447
result.assert_outcomes(passed=1)

0 commit comments

Comments
 (0)
0