diff --git a/src/silx/conftest.py b/src/silx/conftest.py index 0a6a84e6d0..ca1173e110 100644 --- a/src/silx/conftest.py +++ b/src/silx/conftest.py @@ -77,12 +77,21 @@ def pytest_configure(config): "ignore:Non-empty compiler output encountered. Set the environment variable PYOPENCL_COMPILER_OUTPUT=1 to see more.:UserWarning", # Remove __array__ ignore once h5py v3.12 is released "ignore:__array__ implementation doesn't accept a copy keyword, so passing copy=False failed. __array__ must implement 'dtype' and 'copy' keyword arguments.:DeprecationWarning", - "ignore::pyopencl.RepeatedKernelRetrieval", # Deprecated pyparsing usage in matplotlib: https://github.com/matplotlib/matplotlib/issues/30617 "ignore::DeprecationWarning:matplotlib._fontconfig_pattern", "ignore::DeprecationWarning:matplotlib._mathtext", "ignore::DeprecationWarning:pyparsing.util", ) +try: + import pyopencl +except Exception: + pass +else: + pyopen_version = tuple(int(i) for i in pyopencl.__version__.split(".")[:2]) + if pyopen_version >= (2025, 2): + _FILTERWARNINGS = _FILTERWARNINGS + ( + "ignore::pyopencl.RepeatedKernelRetrieval", + ) def pytest_collection_modifyitems(items): diff --git a/src/silx/io/test/test_nxdata.py b/src/silx/io/test/test_nxdata.py index baec00c269..bc7d19f217 100644 --- a/src/silx/io/test/test_nxdata.py +++ b/src/silx/io/test/test_nxdata.py @@ -24,9 +24,10 @@ __authors__ = ["P. Knobel"] __license__ = "MIT" -__date__ = "24/03/2020" +__date__ = "02/12/2025" +import os import tempfile import unittest @@ -490,6 +491,12 @@ def setUp(self): tmp.file.close() self.h5fname = tmp.name + def tearDown(self): + try: + os.unlink(self.h5fname) + except Exception as err: + print(f"{type(err).__name__}: {err}\nWhile deleting `{self.h5fname}`") + def testSimpleSave(self): sig = numpy.array([0, 1, 2]) a0 = numpy.array([2, 3, 4])