You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A number of test functions (listed below) rely on files only created after running utils/create_test_files.py.
Current behaviour: On github, we have configured the automatic tests to first run this script, so there is never an error. However, if you run the tests locally and have not run the create_test_files script, you may be left wondering why there are so many errors (like I was).
Test functions that produce errors if the test files are not present:
calc_response_test.py: all functions
construct_conc_test.py: all functions
interpolate_space_test.py: all functions
read_config_test.py/TestLoadConfig: test_type and test_invalid
read_netcdf_test.py/TestCheckSpecAttributes: all functions
Expected behaviour: The user should be able to run the tests immediately after cloning the repository.
Suggestions for fix: I can think of three options:
Preferred option: Always use simple versions of the required files (config, response, inventory) that do not need to be saved to file, e.g. using a pytest fixture.
Run the create_test_files.py script from the test scripts if the required files are not present. This is not ideal, because you do not want the test scripts to result in saved files.
Write in the documentation/README that you need to run create_test_files.py before testing the program (currently implemented).
Environment:
oac version: v2.8.3
Operating system: Windows 11
The text was updated successfully, but these errors were encountered:
liammegill
changed the title
Multiple test functions rely on nc file that is not included in the repo by default
Multiple test functions rely on files that are not included in the repo by default
Nov 22, 2024
Type of issue
Description
A number of test functions (listed below) rely on files only created after running
utils/create_test_files.py
.Current behaviour: On github, we have configured the automatic tests to first run this script, so there is never an error. However, if you run the tests locally and have not run the
create_test_files
script, you may be left wondering why there are so many errors (like I was).Test functions that produce errors if the test files are not present:
calc_response_test.py
: all functionsconstruct_conc_test.py
: all functionsinterpolate_space_test.py
: all functionsread_config_test.py/TestLoadConfig
:test_type
andtest_invalid
read_netcdf_test.py/TestCheckSpecAttributes
: all functionsExpected behaviour: The user should be able to run the tests immediately after cloning the repository.
Suggestions for fix: I can think of three options:
pytest
fixture.create_test_files.py
script from the test scripts if the required files are not present. This is not ideal, because you do not want the test scripts to result in saved files.create_test_files.py
before testing the program (currently implemented).Environment:
The text was updated successfully, but these errors were encountered: