-
Notifications
You must be signed in to change notification settings - Fork 80
silx.io: Fixed test warnings with Python3.14 #4458
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| 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) |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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
loichuder
left a comment
There was a problem hiding this 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
<Module or Topic>: <Action> <Summary>(see contributing guidelines)This PR rewrites
unitesttests with pytest to remove a miss-usage oftempfileleading to warnings with Python 3.14.closes #4456