Pycharm----Modify script default run and do not generate HTML test report resolution

Source: Internet
Author: User

Python is a tool that often uses pycharm to write code, but when we run the code, we find that there are several

Different operating modes, such as: Run UnitTest in xxx.py, run Xxx.py,run py.test in xxx.py

One, run UnitTest in mode

This is pycharm the default mode of operation, so there are times when you join the Htmltestrunner to generate a report, it will not generate a report for you, because it is unittest to run by default.

To see how to modify:
Win:
1, the win can be changed in the settings

Change the default test runner to Py.test on the line.

2, by editing run/debug configurations to modify

Use the plus sign to add the steps you want to run in a way that runs. and specify the path of the footstep, and then run the footstep with this setting.

3. There is also a case where the file starts with the test*.py name and will be run by default with UnitTest

This can only be removed by the test, and running again will not run as UnitTest.

Mac:
Mac side I only found that through the second third method above, the first method seems to be unable to find the entrance, which students find

Can leave a message to discuss.

Second, run xxx.py

To run this way, you need to set the configurations in edit mode

Click the plus sign to add Python, and then choose a good footstep path, which is shipped with the Python's own idle window

Rows are the same effect.

Third, run py.test in

This approach is also set in configurations mode.

Click the plus sign and select Python tests---py.test, then set the footstep path.

Basic operation of the method with more on these three kinds, especially not in the Unittest.main () mode of operation, we often encounter not to go our code, and the default to go Unittest.main () to run, and when you put your feet in idle is normal. Just follow the above method to set it up just fine.

Pycharm----Modify script default run and do not generate HTML test report resolution

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.