REALLY make sure generated test order is stable

This really does what f87ac17506 should
have done and fixes the horrible bug introduced by that commit.
This commit is contained in:
Tobias Gruetzmacher 2022-06-04 09:26:05 +02:00
parent da30ce29bb
commit 680ba0969e

View file

@ -4,6 +4,7 @@
# Copyright (C) 2015-2022 Tobias Gruetzmacher # Copyright (C) 2015-2022 Tobias Gruetzmacher
import re import re
import os import os
from operator import attrgetter
import pytest import pytest
from xdist.dsession import LoadScopeScheduling from xdist.dsession import LoadScopeScheduling
@ -39,9 +40,8 @@ def get_test_scrapers():
def pytest_generate_tests(metafunc): def pytest_generate_tests(metafunc):
if 'scraperobj' in metafunc.fixturenames: if 'scraperobj' in metafunc.fixturenames:
scrapers = get_test_scrapers() scrapers = sorted(get_test_scrapers(), key=attrgetter('name'))
scraperids = [x.name for x in scrapers] metafunc.parametrize('scraperobj', scrapers, ids=attrgetter('name'))
metafunc.parametrize('scraperobj', scrapers, ids=sorted(scraperids))
class LoadModScheduling(LoadScopeScheduling): class LoadModScheduling(LoadScopeScheduling):