Install in Pycharm to run in Pytest mode

Install in Pycharm to run in Pytest mode

Today, the project uses the Allure Unittest + Pytest integrated test build report. There was a startup error. It was found that the log was repeatedly executed twice, which caused problems in use cases. Checking the information on the Internet found out that the process task was when I started the project.

When you started the project, right click on the run_test.py file and run ‘run_test’. This way of using Pytest use cases is incorrect and not recommended.

a0cf0c938bf6d28c562d729b979d7346

The proper way to set run_test.py files to run use cases in Pytest mode

1、a file == >> settings

2. Enter in the input field:Integrated Python tools

3Virtual test runner change topetiste

11f54e1edfb041979399515e051a593c

4. Select in the upper right cornerEdit configuration clicked

42938572c7bf86bc0a1763111ea39c63

5. Click+,SpecifyPython tests,Specifypetiste

912f424d7baec445cba447918498b917

6. Select Pytes Start -File Path, my run_test.py

7. Choose your version of Python

cc14103518f16e1341078b3f39a40980

8. On startup, select in the upper right cornerpytest in run_test.py Then click the right button to start

b3dd28e263c07d529db3d00c721e95e7

After this setting, the re-execution problem will not occur at startup.

Leave a Comment