File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,10 @@ def test_backends():
2424
2525 for backend in backends :
2626 backend_dir = os .path .join ("tests" , "backends" , backend )
27+ if not os .path .isdir (backend_dir ):
28+ expanded .add (backend )
29+ continue
30+
2731 variants = [
2832 f [:- 3 ]
2933 for f in os .listdir (backend_dir )
@@ -73,6 +77,20 @@ def pytest_generate_tests(metafunc):
7377 from pytest_lazy_fixtures import lf
7478
7579 backends = test_backends ()
80+ requested = metafunc .config .getoption ("backend" )
81+
82+ if requested :
83+ filtered = set ()
84+ for req in requested :
85+ if ":" in req :
86+ if req in backends :
87+ filtered .add (req )
88+ else :
89+ for backend in backends :
90+ if backend == req or backend .startswith (f"{ req } :" ):
91+ filtered .add (backend )
92+ backends = filtered
93+
7694 backends = sorted (backends )
7795
7896 module_name_parts = metafunc .module .__name__ .split ("." )
@@ -82,7 +100,9 @@ def pytest_generate_tests(metafunc):
82100 b for b in backends if b == backend_path or b .startswith (f"{ backend_path } :" )
83101 ]
84102
85- if "backend" in metafunc .fixturenames :
103+ if not matching :
104+ pytest .skip ()
105+ elif "backend" in metafunc .fixturenames :
86106 fixture_names = []
87107 for spec in matching :
88108 fixture_name = (
You can’t perform that action at this time.
0 commit comments