diff --git a/tests/test_indicators.py b/tests/test_indicators.py index 6ff98f893..80ee3901f 100644 --- a/tests/test_indicators.py +++ b/tests/test_indicators.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +# pylint: disable=unsubscriptable-object,function-redefined # Tests for the Indicator objects from __future__ import annotations @@ -159,10 +159,7 @@ def test_attrs(tas_series): assert f"xclim version: {__version__}" in txm.attrs["history"] assert txm.name == "tmin5 degC" assert uniIndTemp.standard_name == "{freq} mean temperature" - assert ( - uniIndTemp.cf_attrs[0]["another_attr"] # pylint: disable=unsubscriptable-object - == "With a value." - ) + assert uniIndTemp.cf_attrs[0]["another_attr"] == "With a value." thresh = xr.DataArray( [1], @@ -260,7 +257,7 @@ def test_temp_unit_conversion(tas_series): with pytest.raises(AssertionError): np.testing.assert_array_almost_equal(txk, txc + 273.15) - uniIndTemp.cf_attrs[0]["units"] = "degC" # pylint: disable=unsubscriptable-object + uniIndTemp.cf_attrs[0]["units"] = "degC" txc = uniIndTemp(a, freq="YS") np.testing.assert_array_almost_equal(txk, txc + 273.15) @@ -761,18 +758,14 @@ def func(data: xr.DataArray, thresh: str = "0 degC", freq: str = "YS"): # noqa # with pytest.raises(ValueError, match="variable data is missing expected units"): # Daily(**d) - d["parameters"]["thresh"] = {"units": "K"} # pylint: disable=function-redefined + d["parameters"]["thresh"] = {"units": "K"} d["realm"] = "mercury" d["input"] = {"data": "tasmin"} with pytest.raises(AttributeError, match="Indicator's realm must be given as one"): Daily(**d) - # fmt: off - def func( # noqa; # pylint: disable=function-redefined - data: xr.DataArray, thresh: str = "0 degC" - ): + def func(data: xr.DataArray, thresh: str = "0 degC"): return data - # fmt: on func.__doc__ = "\n".join(doc[:10] + doc[12:]) d = dict( diff --git a/tests/test_sdba/test_adjustment.py b/tests/test_sdba/test_adjustment.py index 52ff3ae75..7543ae9d7 100644 --- a/tests/test_sdba/test_adjustment.py +++ b/tests/test_sdba/test_adjustment.py @@ -1,3 +1,4 @@ +# pylint: disable=no-member from __future__ import annotations import numpy as np @@ -711,11 +712,7 @@ class TestSBCKutils: @pytest.mark.slow @pytest.mark.parametrize( "method", - # fmt: off - [ - m for m in dir(adjustment) if m.startswith("SBCK_") # pylint: disable=no-member - ], - # fmt: on + [m for m in dir(adjustment) if m.startswith("SBCK_")], ) @pytest.mark.parametrize("use_dask", [True]) # do we gain testing both? def test_sbck(self, method, use_dask, random):