PyCharm doesn't recognize pytests if their name doesn't start with Test

Hi,

we're using pytest and we've re-configured it in `pytest.ini` to find classes that end their names in `Test` instead of beginning their names in `Test` for visual preference.

However, the PyCharm test runner gutter icons don't show for such classes nor methods under them. Is there any way to reconfigure the in-built test finder to support such configuration? (It would be best if it was able to autoconfigure itself from the `pytest.ini` file but any manual configuration even if it's something in internal registry would be fine)

Thanks

2
4 comments

I was wondering if someone had my same question, :D actually yes. I'm interested to know if there's an option for custom test names

0

Hello, 

this is a pytest specific rather than IDE. 

 

However, you are welcome to submit a feature request at https://youtrack.jetbrains.com/issues/PY

Information on how to use YouTrack: https://intellij-support.jetbrains.com/hc/en-us/articles/207241135-How-to-follow-YouTrack-issues-and-receive-notifications

0

Sorry to follow up but pytest allows to configure which test classes can be discovered, thus allowing it to discover *Test named classes.

Looks like Pycharm has hardcoded that it should look for Test* named classes instead of following whichever the configuration for pytest was provided.

I'm facing the same problem of not being able to run tests directly from the editor only on those classes.

0

Looks like the request for this feature was opened 4 years ago:

https://youtrack.jetbrains.com/issue/PY-32154

0

Please sign in to leave a comment.