Skip to content

Commit bacc3f0

Browse files
committed
We still don't have reasonable tests
but at least we can clean up the example.
1 parent c7c5f0a commit bacc3f0

File tree

2 files changed

+5
-20
lines changed

2 files changed

+5
-20
lines changed

tests/conftest.py

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,10 @@
1-
# XX this should switch to using pytest-trio as soon as pytest-trio is
2-
# released...
3-
41
import inspect
52
import pytest
6-
from trio.testing import MockClock, trio_test
3+
from trio.testing import trio_test
74

85
@pytest.fixture
9-
def mock_clock():
10-
return MockClock()
11-
12-
13-
@pytest.fixture
14-
def autojump_clock():
15-
return MockClock(autojump_threshold=0)
16-
6+
async def foo():
7+
yield "bar"
178

189
@pytest.hookimpl(tryfirst=True)
1910
def pytest_pyfunc_call(pyfuncitem):

tests/test_example.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,2 @@
1-
import trio
2-
3-
# We can just use 'async def test_*' to define async tests.
4-
# This also uses a virtual clock fixture, so time passes quickly and
5-
# predictably.
6-
async def test_basic_import():
7-
from trio_gpio import gpio
8-
assert gpio.Card
1+
async def test_basic(foo):
2+
assert foo == "bar"

0 commit comments

Comments
 (0)