Skip to content

Commit ec5a628

Browse files
committed
unit test changes fora pyodide build test
1 parent d661599 commit ec5a628

File tree

2 files changed

+18
-6
lines changed

2 files changed

+18
-6
lines changed

.github/workflows/unit-tests.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,13 @@ jobs:
429429
uses: actions/setup-python@v5
430430
with:
431431
python-version: '3.12'
432+
- name: Cache Emscripten
433+
uses: actions/cache@v3
434+
with:
435+
path: emsdk-cache
436+
key: emsdk-${{ runner.os }}-${{ hashFiles('.github/workflows/unit-tests.yml') }}
437+
restore-keys: |
438+
emsdk-${{ runner.os }}-
432439
433440
- name: Set up Emscripten toolchain
434441
uses: mymindstorm/setup-emsdk@v14
@@ -437,7 +444,9 @@ jobs:
437444
actions-cache-folder: emsdk-cache
438445

439446
- name: Install pyodide-build
440-
run: pip install "pyodide-build>=0.29.2"
447+
run: |
448+
python -m pip install --upgrade pip
449+
python -m pip install "pyodide-build>=0.29.2"
441450
442451
- name: Build pandas for Pyodide
443452
run: |
@@ -452,6 +461,7 @@ jobs:
452461
env:
453462
pyodide-version: '0.27.1'
454463
run: |
464+
set -e # Stop on error
455465
pyodide xbuildenv install ${{ env.pyodide-version }}
456466
pyodide venv .venv-pyodide
457467
source .venv-pyodide/bin/activate
@@ -463,6 +473,7 @@ jobs:
463473
run: |
464474
source .venv-pyodide/bin/activate
465475
pip install pytest hypothesis
466-
# do not import pandas from the checked out repo
467-
cd ..
468-
python -c 'import pandas as pd; pd.test(extra_args=["-m not clipboard and not single_cpu and not slow and not network and not db"])'
476+
# Debugging flags for numerical issues
477+
pytest pandas --maxfail=5 --tb=short -m "not clipboard and not
478+
single_cpu and not slow and not network
479+
and not db" --disable-warnings --durations=10

pandas/tests/window/test_rolling.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1103,9 +1103,10 @@ def test_rolling_sem(frame_or_series):
11031103
def test_rolling_var_numerical_issues(func, third_value, values):
11041104
# GH: 37051
11051105
ds = Series([99999999999999999, 1, third_value, 2, 3, 1, 1])
1106-
result = getattr(ds.rolling(2), func)()
1106+
actual = getattr(ds.rolling(2), func)()
11071107
expected = Series([np.nan] + values)
1108-
tm.assert_almost_equal(result[1:].values, expected[1:].values, rtol=1e-3, atol=1e-6)
1108+
# Use pandas._testing.assert_series_equal
1109+
tm.assert_series_equal(actual, expected, check_less_precise=True, atol=1e-8)
11091110

11101111

11111112
def test_timeoffset_as_window_parameter_for_corr(unit):

0 commit comments

Comments
 (0)