Skip to content

Commit

Permalink
[MRG] Fix nightly build (#570)
Browse files Browse the repository at this point in the history
* Don't use pytest.warns(None)

* use warnings.catch_warnings

* Use python 3.12

* Forgot one

* Use latest cibuildwheel

* Add 'make version'

* Add filter

* liiiiint
  • Loading branch information
aaronreidsmith committed Feb 16, 2024
1 parent 15919ef commit cdf5724
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/nightly_cron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ jobs:
fail-fast: false
matrix:
os: [windows-latest, macos-latest, ubuntu-latest]
python-version: ['3.11']
python-executable: ['cp311']
python-version: ['3.12']
python-executable: ['cp312']
defaults:
run:
shell: bash
Expand Down Expand Up @@ -59,7 +59,7 @@ jobs:
shell: bash

- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.9.0 # TODO: Do we want this pinned?
run: python -m pip install cibuildwheel

- name: Generating dependency table
id: dependency-table # Needed to set output of job
Expand All @@ -78,6 +78,7 @@ jobs:
CIBW_ARCHS_LINUX: "x86_64"
CIBW_ARCHS_MACOS: "x86_64"
CIBW_ARCHS_WINDOWS: "AMD64"
CIBW_BEFORE_ALL: make version
CIBW_BEFORE_BUILD: >
for dependency in ${{ steps.dependencies.outputs.latest_dependencies }}; do
pip install $dependency
Expand Down
12 changes: 8 additions & 4 deletions pmdarima/arima/tests/test_validation.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# -*- coding: utf-8 -*-

import warnings

import numpy as np
import pytest

Expand Down Expand Up @@ -42,7 +44,7 @@ def test_check_information_criterion(ic,
assert any('information_criterion cannot be' in s
for s in pytest_warning_messages(w))
else:
with pytest.warns(None) as w:
with warnings.catch_warnings(record=True) as w:
res = val.check_information_criterion(ic, ooss)
assert not w

Expand Down Expand Up @@ -90,7 +92,7 @@ def test_check_m(m, seasonal, expect_error, expect_warning, expected_val):
assert any('set for non-seasonal fit' in s
for s in pytest_warning_messages(w))
else:
with pytest.warns(None) as w:
with warnings.catch_warnings(record=True) as w:
res = val.check_m(m, seasonal)
assert not w

Expand All @@ -114,7 +116,7 @@ def test_check_n_jobs(stepwise, n_jobs, expect_warning, expected_n_jobs):
assert any('stepwise model cannot be fit in parallel' in s
for s in pytest_warning_messages(w))
else:
with pytest.warns(None) as w:
with warnings.catch_warnings(record=True) as w:
res = val.check_n_jobs(stepwise, n_jobs)
assert not w

Expand Down Expand Up @@ -199,5 +201,7 @@ def test_warn_for_D(d, D, expected):
assert any(expected in w for w in warning_msgs)

else:
with pytest.warns(None):
with warnings.catch_warnings():
# Ensure no warnings are emitted if not expected
warnings.simplefilter("error")
val.warn_for_D(d=d, D=D)

0 comments on commit cdf5724

Please sign in to comment.