Skip to content

Commit 9cda20b

Browse files
Remove trio.tests import causing warnings
It is deprecated and the replacement is made private as trio._tests. While we could be using that, this commit copies over the one relevant function that is actually necessary. The other two imports just repeat tests that are already in trio and do not need repeating here.
1 parent 02daacb commit 9cda20b

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

pytest_trio/_tests/test_hypothesis_interaction.py

+16-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
import pytest
22
import trio
3-
from trio.tests.test_scheduler_determinism import (
4-
scheduler_trace,
5-
test_the_trio_scheduler_is_not_deterministic,
6-
test_the_trio_scheduler_is_deterministic_if_seeded,
7-
)
83
from hypothesis import given, settings, strategies as st
94

105
from pytest_trio.plugin import _trio_test_runner_factory
@@ -38,6 +33,22 @@ async def test_mark_and_parametrize(x, y):
3833
assert y in (1, 2)
3934

4035

36+
async def scheduler_trace():
37+
"""Returns a scheduler-dependent value we can use to check determinism."""
38+
trace = []
39+
40+
async def tracer(name):
41+
for i in range(10):
42+
trace.append((name, i))
43+
await trio.sleep(0)
44+
45+
async with trio.open_nursery() as nursery:
46+
for i in range(5):
47+
nursery.start_soon(tracer, i)
48+
49+
return tuple(trace)
50+
51+
4152
def test_the_trio_scheduler_is_deterministic_under_hypothesis():
4253
traces = []
4354

0 commit comments

Comments
 (0)