Skip to content

Conversation

@t20100
Copy link
Member

@t20100 t20100 commented Jan 9, 2026

This PR rewrites unitest tests with pytest to remove a miss-usage of tempfile leading to warnings with Python 3.14.

closes #4456

@t20100 t20100 added this to the Next major release milestone Jan 9, 2026
@t20100 t20100 requested a review from loichuder January 9, 2026 11:03
Comment on lines +43 to +48
with h5py.File(tmp_path / "nxdata_0D_scalar.h5", "w") as h5f:
group = h5f.create_group("0D_scalar")
group.attrs["NX_class"] = "NXdata"
group.attrs["signal"] = "scalar"
group.create_dataset("scalar", data=10)
group.create_dataset("scalar_errors", data=0.1)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I splitted the previous hdf5 test file generation into each test where it is actually used and also splitted test functions to have one test for each nxdata group.

g1d2.attrs["signal"] = "counts"
g1d2.attrs["axes"] = numpy.array(
[
class TestNXdata:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kept the class to keep the test structure

group.create_dataset("scalar", data=10)
group.create_dataset("scalar_errors", data=0.1)

assert nxdata.is_valid_nxdata(group)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

testValidity is removed and is_valid_nxdata is added to each test

Copy link
Member

@loichuder loichuder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did not look into details but looks much better with the specific creation for each test

@t20100 t20100 merged commit a27b07b into silx-kit:main Jan 9, 2026
3 of 4 checks passed
@t20100 t20100 deleted the fix-test-py314 branch January 9, 2026 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CI: Test python3.14

2 participants