Skip to content

Commit 18c45a5

Browse files
committed
tests: make skips aware of markers
Signed-off-by: Henry Schreiner <[email protected]>
1 parent d0f6668 commit 18c45a5

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

test/conftest.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,10 @@ def docker_warmup_fixture(
154154
@pytest.fixture(params=["pip", "build"])
155155
def build_frontend_env_nouv(request: pytest.FixtureRequest) -> dict[str, str]:
156156
frontend = request.param
157-
if get_platform() == "pyodide" and frontend == "pip":
157+
marks = {m.name for m in request.node.iter_markers()}
158+
159+
platform = "pyodide" if "pyodide" in marks else get_platform()
160+
if platform == "pyodide" and frontend == "pip":
158161
pytest.skip("Can't use pip as build frontend for pyodide platform")
159162

160163
return {"CIBW_BUILD_FRONTEND": frontend}
@@ -163,9 +166,18 @@ def build_frontend_env_nouv(request: pytest.FixtureRequest) -> dict[str, str]:
163166
@pytest.fixture(params=["pip", "build", "build[uv]"])
164167
def build_frontend_env(request: pytest.FixtureRequest) -> dict[str, str]:
165168
frontend = request.param
166-
platform = get_platform()
169+
marks = {m.name for m in request.node.iter_markers()}
170+
if "android" in marks:
171+
platform = "android"
172+
elif "ios" in marks:
173+
platform = "ios"
174+
elif "pyodide" in marks:
175+
platform = "pyodide"
176+
else:
177+
platform = get_platform()
178+
167179
if platform in {"pyodide", "ios", "android"} and frontend == "pip":
168-
pytest.skip("Can't use pip as build frontend for pyodide/ios/android platform")
180+
pytest.skip(f"Can't use pip as build frontend for {platform}")
169181
if platform == "pyodide" and frontend == "build[uv]":
170182
pytest.skip("Can't use uv with pyodide yet")
171183
uv_path = find_uv()

0 commit comments

Comments
 (0)