Configuring the "run this test" feature
已回答
I noticed that PyCharm has a feature where you can right-click any test and run it with the 'Run: Test [name of the method]' menu option (Ctrl+Shift+F10). It doesn't appear to be hooking into the Py.test setup that we use for our Py.test run configurations.
How can I configure this feature? My 'Default test runner' setting is already set to py.test, but it doesn't seem to be respecting the preferences in pytest.ini.
请先登录再写评论。
Hi.
Have you tried 2017.1 EAP?
I haven't, I always stick with stable builds. Does it have a feature that will address my question?
Since 2017.1 EAP we use new test runners that should obey py.test settings and must be as close to native py.test runner as possible.
I have been using unittest, and nosetest to test individual methods in the past. These seemed to remember if I ran a full test from a method in recent PyCharm editions, in which case I lost the right-click context to run a single method. I learned to simply delete the test from configurations and the right-click context behviour would return. With the most recent version (2017.2.3) I have lost this ability completely. Is there something I can do to get it back? See https://stackoverflow.com/questions/36079152/run-a-specific-unit-test-function-inside-pycharm-ide-5-0-4, which seems related. BTW, this is a VERY important productivity feature.
Hello Maki.
Please contact our support or create issue in issue tracker providing project to reproduce if possible.
Right click on test method should give you ability to run it unless you have plain python run configuration. You can also use ALT+SHIFT+F10 to get list of all possible ways to run file