pytest import module code example
Example 1: install pytest
pip install pytest
Example 2: python run pytest
Just type this in shell:
pytest
Or this if that does nott work:
python -m pytest
Example 3: pytest local modules
import sys, os
myPath = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, myPath + '/../')
# from https://stackoverflow.com/questions/10253826/path-issue-with-pytest-importerror-no-module-named-yadayadayada