datasette/tests/conftest.py

23 wiersze
542 B
Python
Czysty Zwykły widok Historia

2019-05-02 05:10:23 +00:00
def pytest_configure(config):
import sys
sys._called_from_test = True
def pytest_unconfigure(config):
import sys
del sys._called_from_test
def pytest_collection_modifyitems(items):
2019-05-11 21:45:59 +00:00
# Ensure test_black.py and test_inspect.py run first before any asyncio code kicks in
move_to_front(items, "test_black")
move_to_front(items, "test_inspect_cli")
def move_to_front(items, test_name):
test = [fn for fn in items if fn.name == test_name]
if test:
items.insert(0, items.pop(items.index(test[0])))