Allow pytest from project base directory#3974
Conversation
|
Note that the tests for "sas/docs/index.html" etc. in "test/system/utest_resources.py" are failing for me, but these tests also fail when using "pytest -s test" and "(cd test && pytest)", so it is outside the scope of this PR. I tried both with an edittable install "uv pip install -e ." which leaves |
|
On the linux CI environment the GUI test is executed using xvfb-run. sasview/.github/workflows/ci.yml Lines 329 to 338 in 3fcd8fb When I run the tests on linux with remote ssh login I did not set up xvfb but still the Qt tests ran to completion. I don't know if that means that the tests that render to the screen are silently ignored in my environment, or if the xvfb environment is not required for the test. I don't see anything in pyproject.toml that is setting up xvfb. |
|
I didn't see errors from Given that |
Description
Allows pytest to run from the project base directory.
The unused sas.sascalc.simulations and sas.sascalc.realspace packages are not scanned for tests.
Fixes the glob pattern to look for files with "test" or "Test" in their name. The previous version was looking for "Testpy", which wasn't finding the utest files in the test directory on case sensitive filesystems. Instead, a second "u*py" glob pattern was introduced to find these tests, but that picks up non-test files such as "util.py" and "urls.py".
Fixes #3892
How Has This Been Tested?
Run "pytest" from the base directory of the project and check that it includes both "Test" files from qtgui and "utest*" files from the test subdirectory. Verify that there are no errors from the tests.
Review Checklist:
[if using the editor, use
[x]in place of[ ]to check a box]Documentation (check at least one)
Installers
Licensing (untick if necessary)