Skip to content

Commit

Permalink
Update warnings filter for pytest
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Giguere committed Jul 2, 2024
1 parent 684da39 commit b083fac
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 3 deletions.
15 changes: 14 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,12 @@ jobs:
# to see if something hung.
timeout-minutes: 60
run: |
pytest --durations=0 --durations-min=1.0 --verbosity=1 --cov=qutip_jax --cov-report= --color=yes -W ignore::UserWarning:qutip -W "ignore:Complex dtype:UserWarning"
pytest -Werror --durations=0 --durations-min=1.0 --verbosity=1 --color=yes \
-W ignore::UserWarning:qutip \
-W "ignore:Complex dtype:UserWarning" \
-W "ignore:jax.core.pp_eqn_rules is deprecated.:DeprecationWarning" \
-W "ignore:unhashable type:FutureWarning" \
-W "ignore:In a future release of JAX,:DeprecationWarning"
# Above flags are:
# --durations=0 --durations-min=1.0
# at the end, show a list of all the tests that took longer than a
Expand All @@ -73,8 +78,16 @@ jobs:
# --cov-report=
# don't print the coverage report to the terminal---it just adds
# cruft, and we're going to upload the .coverage file to Coveralls
# -Werror
# Unless explicitly ignored, warnings are errors.
# -W ignore::UserWarning:qutip
# Ignore matplotlib missing warnings
# -W "ignore:Complex dtype:UserWarning"
# Ignore diffrax's partial complex support
# -W "ignore:jax.core.pp_eqn_rules is deprecated.:DeprecationWarning"
# -W "ignore:unhashable type:FutureWarning"
# -W "ignore:In a future release of JAX,:DeprecationWarning"
# Diffrax / equinox are have warning with latest jax
# These flags are added to those in pyproject.toml.
- name: Upload to Coveralls
Expand Down
15 changes: 14 additions & 1 deletion .github/workflows/weekly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,12 @@ jobs:
# to see if something hung.
timeout-minutes: 60
run: |
pytest --durations=0 --durations-min=1.0 --verbosity=1 --color=yes -W ignore::UserWarning:qutip -W "ignore:Complex dtype:UserWarning"
pytest -Werror --durations=0 --durations-min=1.0 --verbosity=1 --color=yes \
-W ignore::UserWarning:qutip \
-W "ignore:Complex dtype:UserWarning" \
-W "ignore:jax.core.pp_eqn_rules is deprecated.:DeprecationWarning" \
-W "ignore:unhashable type:FutureWarning" \
-W "ignore:In a future release of JAX,:DeprecationWarning"
# Above flags are:
# --durations=0 --durations-min=1.0
# at the end, show a list of all the tests that took longer than a
Expand All @@ -78,8 +83,16 @@ jobs:
# limit coverage reporting to code that's within the qutip_jax package
# --color=yes
# force coloured output in the terminal
# -Werror
# Unless explicitly ignored, warnings are errors.
# -W ignore::UserWarning:qutip
# Ignore matplotlib missing warnings
# -W "ignore:Complex dtype:UserWarning"
# Ignore diffrax's partial complex support
# -W "ignore:jax.core.pp_eqn_rules is deprecated.:DeprecationWarning"
# -W "ignore:unhashable type:FutureWarning"
# -W "ignore:In a future release of JAX,:DeprecationWarning"
# Diffrax / equinox are have warning with latest jax
# These flags are added to those in pyproject.toml.
finalise:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ requires = [
build-backend = "setuptools.build_meta"

[tool.pytest.ini_options]
addopts = "-Werror --strict-config --strict-markers -W \"ignore:Complex dtype:UserWarning\""
addopts = "--strict-config --strict-markers"
testpaths = [
"tests",
]

0 comments on commit b083fac

Please sign in to comment.