Pytest Operations: Difference between revisions
Jump to navigation
Jump to search
Line 5: | Line 5: | ||
python -m pytest | python -m pytest | ||
</syntaxhighlight> | </syntaxhighlight> | ||
=Running from Command Line, Automatically Detecting Tests= | |||
=Executing A Single Test= | =Executing A Single Test= |
Revision as of 20:46, 25 July 2023
Internal
Running pytest As a Module
python -m pytest
Running from Command Line, Automatically Detecting Tests
Executing A Single Test
Executing a Single Test in a Module
pytest test_mod.py::test_func
Executing a Single Test in a Class
pytest test_mod.py::TestClass::test_method
Generate Report
./venv/bin/pip install pytest-html
pytest --html=~/tmp/report.html