pytest commonly used command-line options (a)

1. pytest --help / -help to view all options

2. pytest -m option

Description: mark (marker) for marking the test packets and to quickly select and run.

3. pytest -v option

Description: Use -v / - verbose option, the output will be more detailed information. The most obvious difference is that each file row for each test case, test results and the names will be displayed, rather than just a point or character. As shown below: 

4. pytest -s

Description: Close Captured stdout call output information (success or failure does not show the output), but will appear in the test session start portion equivalent to --capture = no effect

Example:

 $ Pytest teset_sample.py

pyteset $ -s test_sample.py, add the -s no longer display Captured stdout call information, but will show test session starts

 

Guess you like

Origin www.cnblogs.com/helloTerry1987/p/10961522.html