Skip to content

Latest commit

 

History

History
34 lines (22 loc) · 821 Bytes

README.md

File metadata and controls

34 lines (22 loc) · 821 Bytes

Pytest

The pytest framework makes it easy to write small, readable tests, and can scale to support complex functional testing for applications and libraries.

Tutorials

  1. Install package

    pip install pytest
  2. Create test

    • Create a new file called test.py, containing test
    • Test function should start with test_*
  3. Run tests

    pytest -v test.py
  4. Export Result to a file

    pytest -v test.py > test_run_$(date "+%Y-%m-%d_%H:%M:%S").log

    Sample test result pytest/test_run_2023-02-01_17:59:40.log

Additional:

Implement Unit testing with Git Actions as CI