Skip to content

Commit

Permalink
TST: filter a very rare and harmless warning
Browse files Browse the repository at this point in the history
  • Loading branch information
neutrinoceros committed Mar 20, 2022
1 parent 5386297 commit fd4a6cc
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from pathlib import Path

import matplotlib
import numpy
import pytest
import yaml
from packaging.version import Version
Expand All @@ -20,6 +21,7 @@
)

MPL_VERSION = Version(matplotlib.__version__)
NUMPY_VERSION = Version(numpy.__version__)


def pytest_addoption(parser):
Expand Down Expand Up @@ -113,6 +115,15 @@ def pytest_configure(config):
):
config.addinivalue_line("filterwarnings", value)

if NUMPY_VERSION < Version("1.19") and MPL_VERSION < Version("3.3"):
# This warning is triggered from matplotlib in exactly one test at the time of writing
# and exclusively on the minimal test env. Upgrading numpy or matplotlib resolves
# the issue, so we can afford to ignore it.
config.addinivalue_line(
"filterwarnings",
"ignore:invalid value encountered in less_equal:RuntimeWarning",
)

if find_spec("astropy") is not None:
# at the time of writing, astropy's wheels are behind numpy's latest
# version but this doesn't cause actual problems in our test suite
Expand Down

0 comments on commit fd4a6cc

Please sign in to comment.