Double clicking failed or passed test, brings me to External Libraries/Lib/Test

Hello,

I'm having a problem running unittests in PyCharm. Usually, when I double-click any passed or failed test it brings me to the test code related to the test. This isn't the case anymore, instead, it brings me to the External Libraries/Lib/Test.

Does anyone have any idea how to fix this?

0

Hi,

Have you checked if it reproduces in a new project with some simple tests?
If not, could you provide steps and some code for reproducing it?

0
Avatar
Permanently deleted user

Thanks for the reply Sergey.

I wasn't able to reproduce the error beyond the scope of the project.
I tried deleting the test folder in Lib and that actually solved the problem.
That probably is not the way to go since it might have consequences.


It is worth mentioning that the problem started occurring after updating PyCharm.

 

 

0

Do you store your venv inside the project?
If yes, it should be excluded.

0

FWIW, I am having exactly the same problem, also after updating PyCharm.  Instead of opening MY test when I double-click a test name in the runner, it opens some random dependency's tests.py file, in this case the tests.py belonging to pip, in vendor/webencodings. 

After marking my venvs as Excluded, the behavior changed to double-clicking (or cmd-down_arrow) having no effect whatsoever, which is not really much better.

If it makes any difference, my project has multiple source roots, one for the main project, and one for tests.  Cleaning up old .pyc and .pytest_cache files and reloading the project from disk had no effect.

0

Having exactly the same problem. The problem also started after the last PyCharm update.

0

Could you please submit steps to reproduce the issue to https://youtrack.jetbrains.com/issues/py ?

0

Could you please post an exact link to the issue not just the main page of the issue tracker? I'm having the same problem and it really disturbs my workflow. Using 2022.1, linux. So it seems to persist since at least two years, now.

May be related to https://youtrack.jetbrains.com/issue/PY-47727 and https://intellij-support.jetbrains.com/hc/en-us/community/posts/206877055-Right-click-on-a-test-class-does-not-show-the-run-options?page=1#community_comment_5308917520786

0

请先登录再写评论。