I think it is possible to change the tests code so that it is easier to read and maintain:
Currently the tests use sys.path.append for the imports instead of importing torchquad, so __init__.py is not executed.
It may be possible to shorten the code by replacing the setup_test_for_backend with parameterized tests.
utils_integration_test.py shows warnings while the other code uses pytest skips if a backend is not installed. The code could be changed so that pytest skips are used everywhere.
Some of these changes may however make it more difficult to support the execution of the test files with python3 in addition to pytest.
I think it is possible to change the tests code so that it is easier to read and maintain:
sys.path.append
for the imports instead of importing torchquad, so__init__.py
is not executed.utils_integration_test.py
shows warnings while the other code uses pytest skips if a backend is not installed. The code could be changed so that pytest skips are used everywhere.Some of these changes may however make it more difficult to support the execution of the test files with
python3
in addition topytest
.