Skip to content

Commit 7c7eee9

Browse files
Add runtime type checking in CI tests
This should prevent TYPE_CHECKING misuse. It might also found issues not found by static type checking, typically by the current MyPy.
1 parent 5515aec commit 7c7eee9

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

.github/workflows/ci.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,10 @@ jobs:
126126
run: |
127127
python -m pip install pytest-github-actions-annotate-failures
128128
129+
- name: Install beartype
130+
run: |
131+
python -m pip install pytest-beartype
132+
129133
- name: Install xarray
130134
run: |
131135
python -m pip install --no-deps -e .
@@ -152,6 +156,7 @@ jobs:
152156
--cov=xarray
153157
--cov-report=xml
154158
--junitxml=pytest.xml
159+
--beartype-packages=xarray
155160

156161
- name: Upload test results
157162
if: always()

pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ dev = [
4141
"mypy",
4242
"pre-commit",
4343
"pytest",
44+
"pytest-beartype",
4445
"pytest-cov",
4546
"pytest-env",
4647
"pytest-xdist",

0 commit comments

Comments
 (0)