Testing#
Teacher uses the pytest framework.
The tests are in the tests in each module.
Requirements#
To run the tests you will need to set up Teacher for development.
Running the tests#
In the root directory of your development repository run:
python -m pytest
pytest can be configured via a lot of command-line parameters. Some particularly useful ones are:
|
Be more verbose |
|
Do not capture stdout |
To run a single test from the command line, you can provide a file path, optionally followed by the function separated by two colons, e.g., (tests do not need to be installed, but Teacher should be):
pytest teacher/fuzzy/tests/test_base.py::test_get_dataset_membership
Using GitHub Actions for CI#
GitHub Actions is a hosted CI system “in the cloud”.
GitHub Actions is configured to receive notifications of new commits to GitHub
repos and to run builds or tests when it sees these new commits. It looks for a
YAML files in .github/workflows to see how to test the project.
GitHub Actions is already enabled for the main Teacher GitHub repository.
GitHub Actions should be automatically enabled for your personal Teacher fork once the YAML workflow files are in it. It generally isn’t necessary to look at these workflows, since any pull request submitted against the main Teacher repository will be tested.
You can see the GitHub Actions results at your_GitHub_user_name/teacher.