By focusing on the “temporarily disabled” part of the question, the best answer is to some extent dependent on the use case. The use case that brought me here is that I am doing a test development of the function. In this process, I write tests sequentially and often use breakpoints in functions for debugging. If I just run all the tests every time I run the tester, I stop at breakpoints for tests that are already running. Adding a “skip” or changing the name of the test or something like that is not what I want, because when I finish writing the function, I want all the tests to run. If I used to skip, I would have to go back and cancel.
For my use case, the solution is a test run, not a test code. I am using Pytest . With pytest, you can easily determine one test from the command line:
pytest PYTHON_FILENAME.TEST_CLASS.TEST_NAME
(replace the uppercase letters with your values).
I understand that this question was for python-unitest. I have not used this for a long time. I would not be surprised if he had something like pytest. If not, you can easily switch to pytest. You do not need to change your code. Just install it and change the command to run the test.
I also use PyCharm Pro. There is a small icon on the page with my test code next to the definition for each test. I can click on this icon and run this test separately.
Chuck Feb 06 '19 at 19:11 2019-02-06 19:11
source share