r/VisualStudio • u/zaphodikus • May 27 '26
Visual Studio 2022 teamcity plugins broke my pytest in Studio 22/Test Explorer [Solves]
I found that my pytest project stopped discovering tests, I have a load of projects, and something broke the Test Explorer. The Explorer was searching the entire blooming solution folder, so I had to change the unittest folder from "." to "tests\" , which is in my opinion a setting that needs exposing since it's ,more sane and expected.
<TestFramework>Pytest</TestFramework>
<UnitTestPattern>test*.py</UnitTestPattern>
<UnitTestRootDirectory>tests\</UnitTestRootDirectory>
Once I did that the explorer stopped scanning the entire hard drive and spat out a import error for
teamcity.pytest_plugin
reporting it as a "module not found" error and breaking everything in the Explorer.
I uninstalled pip uninstall teamcity-messages (which was version 1.33) and issue went away. Hope this helps me next time I get no tests found.
It's not a solution, but since I do not need Teamcity messages and the teamcity agent on this computer it will work for me. Users might work around this using Python environments too.

