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