How WingPro 7 Mac version of unit testing?

Wing Pro testing and debugging tools can easily run into unittest doctest, pytest, nose and Django unit testing framework written unit tests.

22111227_750571121a.jpeg

We now try it. First, open the Project Properties and insert a set Glob / Wildcard of test File Pattern and test _ * .py in the Testing tab. This tells Wing your project file which is a unit test files. Press "OK" or "Apply", then open the "test" tool from the "Tools" menu. Test_example1.py file should now contain entries:

/images/doc/en/intro/testing.png

Next in line is commented PromptToContinue example1.py read, so that by testing the load module without prompting.

Then press the test run test tool. You should see three tests in two by a will fail:

/images/doc/en/intro/testing-results.png

You can expand the tree to view detailed information about failed tests, including a test print and output any abnormal occurrence. Double-click on abnormal test results and will be transferred to the relevant code.

Note that you can also pass the test you want to run and select "Run test cursor in the" from "test" menu, from the editor to run the test.

Commissioning tests

Now in the debugger fails the testFailure, clicking Debug Tests it and press the top of the test tool in the tool. Wing should stop at the anomaly, you can use the debugger in the test, just like any other Python code is the same.

surroundings

When running the tool in the test unit tests, by default they are running the same environment and for debugging code in execution. "File Properties" can use the "Project Properties" and "test", "Environment" tab or unit test file to change this setting.


Guess you like

Origin blog.51cto.com/14370425/2422485