Background
In order to provide an easier testing experience, we can utilize pytest's own test discovery features. If we structure the tests such that we can just run them from the top level, without having to change directories, this will be easier to choose which tests to run (unit / integration).
We have the following test structure:
| - atomsci
| | - ddm
| | | - test
| | | | - integrative
| | | | - unit
It would be nice if we could just run:
AMPL $~ venv/bin/pytest atomsci/ddm/test/unit
OR run all tests from the same directory
AMPL $~ venv/bin/pytest atomsci/atomsci/ddm/test
Unfortunately, when running from the top level directory, the following tests fail:

============================================================================== short test summary info ==============================================================================
FAILED atomsci/ddm/test/unit/test_model_dataset.py::test_load_presplit_dataset - FileNotFoundError: [Errno 2] No such file or directory: '../test_datasets/H1_hybrid.json'
FAILED atomsci/ddm/test/unit/test_param_parser.py::test_default_params_command_with_dataset_hash - AttributeError: 'Namespace' object has no attribute 'dataset_hash'
FAILED atomsci/ddm/test/unit/test_model_version.py::test_get_ampl_version_by_file - FileNotFoundError: [Errno 2] No such file or directory: '/home/ddm/examples/archive/tutorials2021/models/aurka_union_trainset_base_smiles_model_ampl_120_2fb9ae80-26d4-4f27-af28-2e9e9db594de.tar.gz'
FAILED atomsci/ddm/test/unit/test_model_version.py::test_get_ampl_version_by_dir - AssertionError: assert 1 >= 2
+ where 1 = len([''])
FAILED atomsci/ddm/test/unit/test_model_version.py::test_check_versions_compatible_ignore_check - ValueError: Input /home/ddm/examples/archive/tutorials2021/models/aurka_union_trainset_base_smiles_model_ampl_120_2fb9ae80-26d4-4f27-af28-2e9e9db594de.tar.gz is not valid version format.
ERROR atomsci/ddm/test/unit/test_model_file_reader.py - FileNotFoundError: [Errno 2] No such file or directory: '../../examples/BSEP/models/bsep_classif_scaffold_split.tar.gz'
ERROR atomsci/ddm/test/unit/test_model_file_reader.py - FileNotFoundError: [Errno 2] No such file or directory: '../../examples/BSEP/models/bsep_classif_scaffold_split.tar.gz'
========================================================== 5 failed, 82 passed, 20 warnings, 2 errors in 67.88s (0:01:07) ===========================================================
I think these are just tests which need to have proper path composition from the root directory
Background
In order to provide an easier testing experience, we can utilize pytest's own test discovery features. If we structure the tests such that we can just run them from the top level, without having to change directories, this will be easier to choose which tests to run (unit / integration).
We have the following test structure:
| - atomsci
| | - ddm
| | | - test
| | | | - integrative
| | | | - unit
It would be nice if we could just run:
OR run all tests from the same directory
Unfortunately, when running from the top level directory, the following tests fail:
I think these are just tests which need to have proper path composition from the root directory