pytest-describe icon indicating copy to clipboard operation
pytest-describe copied to clipboard

Pycharm support

Open dimberman opened this issue 2 years ago • 4 comments

Hello all!

I'm testing out the library right now and I'm noticing that if I create describe scenarios in pycharm there doesn't seem to be a way to run single test. For normal pytest or unittest tests I can see a play button that allows running just that test Screen Shot 2022-03-22 at 11 51 18 AM

However when I try to run a pytest-describe scenario it seems I have to run the entire file to get those tests to run Screen Shot 2022-03-22 at 11 51 26 AM

Is there something I can do to have pycharm recognize this? I didn't see a specific pytest-describe plugin

dimberman avatar Mar 22 '22 18:03 dimberman

Upvote! 👍

miinx avatar May 09 '22 05:05 miinx

It probably needs to be resolved in the IDE.

However, you can run the tests via the IDE without the buttons: If you click somewhere in the file in the editor window and press the "Run 'Python tests in test…'" shortcut (by default Ctrl + Shift + F10 for Windows and Linux and Control + Shift + R for MacOS) the tests should be executed via the IDE.

qutax avatar May 23 '22 11:05 qutax

@dimberman we noticed the same problem. If you still prefix your test names with test_, then PyCharm will pick those up and let you run them individually. They will also still roll up under the describe block in the output. It's the best of both worlds! :)

jwsloan avatar Feb 01 '23 12:02 jwsloan

I've created a PyCharm issue now asking for support on the end of PyCharm. I don't think it's a big usability issue, but of course would be nice if that would be supported there.

Thanks @qutax and @jwsloan for posting the workarounds.

Cito avatar Apr 09 '23 11:04 Cito