Skip to content

Commit 140bc1a

Browse files
henryiiimayeut
andauthored
tests: mark and add skips (#2524)
* tests: mark and add skips Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> * fix comment --------- Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> Co-authored-by: Matthieu Darbois <mayeut@users.noreply.github.com>
1 parent 55fcb25 commit 140bc1a

5 files changed

Lines changed: 24 additions & 3 deletions

File tree

.github/workflows/test.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ jobs:
5151
needs: lint
5252
runs-on: ${{ matrix.os }}
5353
strategy:
54+
fail-fast: false
5455
matrix:
5556
os: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, windows-11-arm, macos-13, macos-15]
5657
python_version: ['3.13']
@@ -97,6 +98,7 @@ jobs:
9798
uv sync --no-dev --group test
9899
99100
- uses: joerick/pr-labels-action@v1.0.9
101+
100102
- name: Set CIBW_ENABLE
101103
shell: bash
102104
run: |
@@ -134,16 +136,16 @@ jobs:
134136
with:
135137
package-dir: sample_proj
136138
output-dir: wheelhouse_only
137-
only: cp312-${{ runner.os == 'Linux' && (runner.arch == 'ARM64' && 'manylinux_aarch64' || 'manylinux_x86_64') || (runner.os == 'Windows' && 'win_amd64' || 'macosx_x86_64') }}
139+
only: cp313-${{ runner.os == 'Linux' && (runner.arch == 'ARM64' && 'manylinux_aarch64' || 'manylinux_x86_64') || (runner.os == 'Windows' && 'win_amd64' || 'macosx_x86_64') }}
138140

139141
- name: Create custom configuration file
140142
shell: bash
141143
run: |
142144
cat > sample_proj/cibw.toml <<EOF
143145
[tool.cibuildwheel]
144-
# Only build on CPython 3.12 on native arch
146+
# Only build on CPython 3.13 on native arch
145147
archs = ["native"]
146-
build = "cp312-*"
148+
build = "cp313-*"
147149
# Skip musllinux
148150
skip = "*-musllinux*"
149151
EOF

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,9 @@ filterwarnings = ["error"]
109109
log_cli_level = "INFO"
110110
markers = [
111111
"serial: tests that must *not* be run in parallel (deselect with '-m \"not serial\"')",
112+
"ios: tests that run on iOS",
113+
"android: tests that run on Android",
114+
"pyodide: tests that run on Pyodide",
112115
]
113116

114117
[tool.mypy]

test/test_android.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
from .test_projects import new_c_project
1313
from .utils import cibuildwheel_run, expected_wheels
1414

15+
pytestmark = pytest.mark.android
16+
17+
1518
CIBW_PLATFORM = os.environ.get("CIBW_PLATFORM", "android")
1619
if CIBW_PLATFORM != "android":
1720
pytest.skip(f"{CIBW_PLATFORM=}", allow_module_level=True)

test/test_ios.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@
1212

1313
from . import test_projects, utils
1414

15+
pytestmark = pytest.mark.ios
16+
17+
CIBW_PLATFORM = os.environ.get("CIBW_PLATFORM", "ios")
18+
if CIBW_PLATFORM != "ios":
19+
pytest.skip(f"{CIBW_PLATFORM=}", allow_module_level=True)
20+
1521
basic_project_files = {
1622
"tests/test_platform.py": f"""
1723
import platform

test/test_pyodide.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import contextlib
2+
import os
23
import subprocess
34
import sys
45
import textwrap
@@ -9,6 +10,12 @@
910

1011
from . import test_projects, utils
1112

13+
pytestmark = pytest.mark.pyodide
14+
15+
CIBW_PLATFORM = os.environ.get("CIBW_PLATFORM", "pyodide")
16+
if CIBW_PLATFORM != "pyodide":
17+
pytest.skip(f"{CIBW_PLATFORM=}", allow_module_level=True)
18+
1219
basic_project = test_projects.new_c_project()
1320
basic_project.files["check_node.py"] = r"""
1421
import sys

0 commit comments

Comments
 (0)