From 3a6cfd3d73aec112e8e37fb1d8d16fba8a9feb5c Mon Sep 17 00:00:00 2001 From: Ryan May Date: Wed, 8 Nov 2023 17:19:45 -0700 Subject: [PATCH] MNT: Fix xpass and make xpass fail suite The fix in pint for the original issue has been released, so we can have a condition on the xpass. --- pyproject.toml | 1 + tests/calc/test_indices.py | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index e3140de250c..e067e01be22 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -102,6 +102,7 @@ markers = "xfail_dask: marks tests as expected to fail with Dask arrays" norecursedirs = "build docs .idea" doctest_optionflags = "NORMALIZE_WHITESPACE" mpl-results-path = "test_output" +xfail_strict = true filterwarnings = [ "ignore:numpy.ndarray size changed:RuntimeWarning", # To be removed in the next python-dateutil release. diff --git a/tests/calc/test_indices.py b/tests/calc/test_indices.py index 4a954d16c00..5f3878246ab 100644 --- a/tests/calc/test_indices.py +++ b/tests/calc/test_indices.py @@ -6,6 +6,8 @@ from datetime import datetime import numpy as np +import packaging.version +import pint import pytest import xarray as xr @@ -130,7 +132,8 @@ def test_weighted_continuous_average(): assert_almost_equal(v, 6.900543760612305 * units('m/s'), 7) -@pytest.mark.xfail(reason='hgrecco/pint#1593') +@pytest.mark.xfail(packaging.version.parse(pint.__version__) < packaging.version.parse('0.21'), + reason='hgrecco/pint#1593') def test_weighted_continuous_average_temperature(): """Test pressure-weighted mean temperature function with vertical interpolation.""" data = get_upper_air_data(datetime(2016, 5, 22, 0), 'DDC')