Cannot run unittest.TestSuite() anymore - PyCharm version 2017.1.2
已回答
Hi,
I used to run my unittest.TestSuite() by placing the following code into __init__.py (using PyCharm versions before 2017.1)
def load_tests(loader, tests, pattern):
print "here"
spn_rt = zz_release_test.SPN_Release_Test()
return spn_rt.get_suite()
I followed this example:
http://stackoverflow.com/questions/36847349/pycharm-run-select-unittests
However, with the current version of PyCharm this does not work anymore.
Could you please tell me how to run a specific list of test (specified in different modules) within PyCharm?
Thanks,
Stephan
请先登录再写评论。
Hello.
This scenario is not fully supported yet (https://youtrack.jetbrains.com/issue/PY-24274) but you can use workaround.
Create run configuration, set target to "custom" and set qualified name of your test package as additional argument
Hi,
thanks for the reply. I tried to run it with your setup, but I'm not fully satisfied as I don't get the individual output of the testcases.
It would be great if you could show me a little working example.
Thanks in advance,
Stephan
Hello.
Sorry, I probably misunderstood you. What do you mean by "individual output"? Could you provide screenshot please?
I've attached example project to https://youtrack.jetbrains.com/issue/PY-24274 to illustrate how to utilize "load test protocol" with PyCharm. You can download and run it to check how it works.
Hi,
thanks for the example project. I managed to get it running.
Best wishes,
Stephan