.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "11_demos\python_packages\pyTest\runPyTest.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_11_demos_python_packages_pyTest_runPyTest.py: Pytest ========= Execute lines from this file from demo folder to run all subsequent pytest scripts. .. hint:: from pytest version ``5.x`` onwards make sure to use -p no:faulthandler Run pytest using line below. run it from within the pytestfolder in the demo scripts itom folder modules that are import ed once dont get reimportet, so restart itom frequently capturing stdin/out/err is not possible since os.openfd is not supported by itom run from within itom console... .. GENERATED FROM PYTHON SOURCE LINES 14-30 .. code-block:: Python import pytest # this one collects ALL the scripts from the topLevelfolder(..) # omit the collect-only switch to run them all pytest.main(["../", "-v", "--capture=no", "--collect-only", "-c=./pytest.ini"]) # this one runs only tests from certain file pytest.main(["../demoDataObject.py", "--capture=no", "-c=./pytest.ini"]) # and there are many more mnipulations possible, documented on http://pytest.org/en/latest/ # Configuration is more easily done in the *.ini and conftest.py files. # So here two more helpful examples: # this one runs all the demo functions pytest.main(["../", "-v", "--capture=no", "--collect-only", "-c=./pytest_demo.ini"]) # this one runs all the user demo functions, which require interaction from the user. pytest.main(["../", "-v", "--capture=no", "-c=./pytest_userdemo.ini"]) .. _sphx_glr_download_11_demos_python_packages_pyTest_runPyTest.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: runPyTest.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: runPyTest.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: runPyTest.zip `