pytest-dev / pytest-describe

Describe-style plugin for the pytest framework
MIT License
212 stars 18 forks source link

Pycharm support #42

Open dimberman opened 2 years ago

dimberman commented 2 years ago

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

miinx commented 2 years ago

Upvote! 👍

qutax commented 2 years ago

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.

jwsloan commented 1 year ago

@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! :)

Cito commented 1 year ago

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.