Pytest Operations: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 1: Line 1:
=Internal=
=Internal=
* [[Pytest#Subjects|Pytest]]
* [[Pytest#Subjects|Pytest]]
=Running pytest As a Module=
<syntaxhighlight lang='bash'>
python -m pytest
</syntaxhighlight>
=Executing A Single Test=
=Executing A Single Test=
==Executing a Single Test in a Module==
==Executing a Single Test in a Module==

Revision as of 23:04, 2 May 2023

Internal

Running pytest As a Module

python -m pytest

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