Difference between revisions of "Python pytest"
From John Freier
(Created page with "To run tests in a specific dir pytest path/to/dir To run tests in a specific file pytest path/to/test_file.py To run a specific test in a file pytest path/to/test_file...") |
|||
Line 7: | Line 7: | ||
To run a specific test in a file | To run a specific test in a file | ||
pytest path/to/test_file.py::test_function | pytest path/to/test_file.py::test_function | ||
+ | |||
+ | To show the print statements. | ||
+ | -s or --capture=no |
Revision as of 13:01, 2 May 2023
To run tests in a specific dir
pytest path/to/dir
To run tests in a specific file
pytest path/to/test_file.py
To run a specific test in a file
pytest path/to/test_file.py::test_function
To show the print statements.
-s or --capture=no