Skip to content

Commit b6241a5

Browse files
authored
enable doctests (#101)
1 parent 2a4ddb1 commit b6241a5

File tree

2 files changed

+24
-3
lines changed

2 files changed

+24
-3
lines changed

.github/workflows/ci.yaml

+21
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,24 @@ jobs:
6565
env_vars: RUNNER_OS,PYTHON_VERSION
6666
name: codecov-umbrella
6767
fail_ci_if_error: false
68+
69+
doctest:
70+
runs-on: ubuntu-latest
71+
strategy:
72+
fail-fast: false
73+
matrix:
74+
python-version: ["3.11"]
75+
76+
steps:
77+
- uses: actions/checkout@v4
78+
- name: Set up Python ${{ matrix.python-version }}
79+
uses: actions/setup-python@v5
80+
with:
81+
python-version: ${{ matrix.python-version }}
82+
- name: Install dependencies
83+
run: |
84+
python -m pip install --upgrade pip
85+
python -m pip install pytest -e .
86+
- name: Test with pytest
87+
run: |
88+
python -m pytest --doctest-modules mplotutils --ignore mplotutils/tests

mplotutils/cartopy_utils.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,12 @@ def cyclic_dataarray(obj, coord="lon"):
103103
... )
104104
>>> data_cyclic = cyclic_dataarray(data, 'y')
105105
>>> data_cyclic
106-
<xarray.DataArray (x: 2, y: 4)>
106+
<xarray.DataArray (x: 2, y: 4)> Size: 64B
107107
array([[1, 2, 3, 1],
108108
[4, 5, 6, 4]])
109109
Coordinates:
110-
* x (x) int64 1 2
111-
* y (y) int64 0 1 2 3
110+
* x (x) int64 16B 1 2
111+
* y (y) int64 32B 0 1 2 3
112112
113113
"""
114114

0 commit comments

Comments
 (0)