Black + fix broken test

This commit is contained in:
Simon Willison 2019-05-11 14:45:59 -07:00
commit a187c81e0c
2 changed files with 13 additions and 6 deletions

View file

@ -11,7 +11,12 @@ def pytest_unconfigure(config):
def pytest_collection_modifyitems(items):
# Ensure test_black.py runs first before any asyncio code kicks in
test_black = [fn for fn in items if fn.name == "test_black"]
if test_black:
items.insert(0, items.pop(items.index(test_black[0])))
# 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])))