install pytest for python 3 code example
Example 1: install pytest
pip install pytest
Example 2: pytest installation windows
pip install -U pytest
Example 3: python run pytest
Just type this in shell:
pytest
Or this if that does nott work:
python -m pytest
Example 4: pytest
# content of test_sample.py
def inc(x):
return x + 1
def test_answer():
assert inc(3) == 5