To run the unit tests, the recommended approach is:
cd doaj/doajtest/unit
pytest 2>&1 | tee test-output.txt
To analyse for slow tests, use
cd doaj/doajtest/unit
pytest --duration=0 2>&1 | tee test-output.txt
$PATH_VENV_DOAJ/bin/pytest --color=yes --code-highlight=yes -n 8 --dist loadfile $DOAJ_CODE_HOME/doajtest/unit
Following are the guide to write unit test for parallelised:
- avoid use same folder path in difference test case
- if you need folder for test case, you can use
create_tmp_dir
to create new folder with random name. - if test case required
STORE_IMPL
,StoreLocal
,STORE_TMP_IMPL
, you may need to useStoreLocalPatcher
, it will create random path forStoreLocal
See: Testbook section from ../docs/README.md