Introduction
A unit test is a smaller test that verifies that a particular component works properly.
A unit test allows you to isolate and fix problems in your application more quickly.
corva-sdk provides convenient tools for testing through the pytest plugin.
It is recommended to keep your test units in a separate test folder that is created for you automatically by the app generator.
Test folder
The app generator automatically adds pytest to requirements.txt.
App generator
In general, pytest is invoked with the command pytest. This will find all files whose names follow the form test_*.py or \*_test.py
in the current directory and its subdirectories. Then from those files, collect test items:
-
test prefixed test functions or methods outside of class
-
test prefixed test functions or methods inside Test prefixed test classes (without an init method)
More information:
How pytest works: Pytest: Writing plugins
General information and examples: Corva Python SDK