-
Notifications
You must be signed in to change notification settings - Fork 519
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
--no-network test option not recognised #2286
Comments
I implemented the
|
That's a good hint. The nonetwork marker is indeed defined in pytest.ini. So running tests from a different directory might be related to my issue (though in that case still strange that I got the option working with the square brackets). I'll investigate further. |
The pytest skip messages indicate your libhdf5 was not built with the ros3 virtual file driver. Only if ros3 is available the |
I see. That must mean the pip build didn't have ros. I'm actually trying to build (and test) from source, my system hdf5 does support ros3. I was using the pip build as a reference since I was getting the problem with the --no-network test option from the source build. The ros3 tests do pass for my source build, but I'm trying to set up a build configuration where --no-network can be specified explicitly (for building on systems without network access) |
Nope, I can't get it just with the pytest.ini file. I can't run the test from the source dir where pytest.ini comes from anyway, since that gives the ImportError If I try the test from an empty directory then the behaviour is the same You're right, I was mislead by the As a workaround I can effectively skip the net-related tests by accessing the marker directly via But I'm otherwise stuck. Could the problem be a matter of pytest version? My pytest is 7.4.0. v7.4.0 was only recently released, it does break some things. pytest-dev/pytest#11134 |
One more observation, running tests from an installed build. Each of But the tests skip successfully without
Specifying the tests dir like this without the
I get the PytestUnknownMarkWarning even if I copy pytest.ini to the empty dir I'm launching the tests from. |
I am not a pytest expert but I cannot replicate your problem. I created a new conda environment and installed h5py from conda-forge channel. Both of the commands below work without any unknown marker warnings:
Using pytest 7.4.0. |
The first version works for me, specifying the directory. The second one fails. I guess its related to the pytest conf discovery rules, which the pytest issues raise as a problem several times. Possibly the problem is triggered by the extra layer in the debian builds providing both serial and mpi variants. I'll try a direct build without the debian layering. |
I'm trying to test a build of h5py 3.9.0 using the
--no-network
option defined in h5py/tests/conftest.pyBut the option is not being recognised when launching tests inside python using h5py.run_tests(), for instance,
The option does work successfully if I run as pytest from the command line,
$ pytest-3 -v --no-network ~/.local/lib/python3.11/site-packages/h5py/tests/test_ros3.py
And the option does work from h5py.run_tests(), but only when enclosed in square brackets,
This use of square brackets is not intuitive, I almost did not find it. The
-v
and-k
options were accepted without square brackets. Does it mean there is some bug with the option configuration? Is there some existing documentation (possibly pytest documentation) for it? Or should the behaviour be documented e.g. in h5py/tests/conftest.py or in h5py docs?System:
The text was updated successfully, but these errors were encountered: