+# Make the test results available to fixtures
+@pytest.hookimpl(tryfirst=True, hookwrapper=True)
+def pytest_runtest_makereport(item, call):
+ other_hooks = yield
+ report = other_hooks.get_result()
+ bup = item.__dict__.setdefault('bup', {})
+ bup[report.when + '-report'] = report # setup, call, teardown
+ item.bup = bup
+
+def bup_test_sort_order(item):
+ # Pull some slower tests forward to speed parallel runs
+ if item.fspath.basename in ('test_get.py', 'test-index.sh'):
+ return (0, str(item.fspath))
+ return (1, str(item.fspath))
+
+def pytest_collection_modifyitems(session, config, items):
+ items.sort(key=bup_test_sort_order)
+