-
Notifications
You must be signed in to change notification settings - Fork 3
Testing
tmol uses the pytest
testing framework.
pytest -v --durations=25 --cov=./tmol --junitxml=testing.cpu.junit.xml
pytest tmol/tests/path/to/your_test_file.py -s -k test_name_substring
Note
-s keeps pytest from capturing your stdout stream, so that you can see any debug print statements that you might have put in. -k runs tests within the file that contain the substring that follows. Use this if you want to only run a specific test
Tests are contained in the tmol/tests/
subdirectory. Edit or create a file to add your tests.
The actual tests are functions in these files that start with 'test_'. Pytest will consider any functions with this prefix as tests, including functions inside class definitions.
Pytest 'fixtures' can be used to supply input to your tests. For example, the included 'ubq_res' fixture gives you access to the ubiquitin PDB, and the 'default_database' fixture gives you the tmol database.