Pytest Operations: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 9: Line 9:
<syntaxhighlight lang='bash'>
<syntaxhighlight lang='bash'>
pytest test_mod.py::TestClass::test_method
pytest test_mod.py::TestClass::test_method
</syntaxhighlight>
==Generate Report==
<syntaxhighlight lang='bash'>
./venv/bin/pip install pytest-html
pytest --html=~/tmp/report.html
</syntaxhighlight>
</syntaxhighlight>

Revision as of 02:41, 12 July 2022

Internal

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