Replies: 1 comment 5 replies
-
Hi @tomghc, thanks for reaching out! First which line do you mean by "I tried commenting out the line above"? I might be missing something but I am not sure what line you are referring to. |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I recently noticed that in ms-python
v2023.20.0
running a specific test, test module, test directory etc triggers a discovery. I traced this back to unittestadapter, which seemingly uses my unittest settings (see below) and this results in all tests being discovered. Ultimately, the plugin seems to discard the outputs immediately though.In my case, this actually causes problems as I am using abseil to manage CLI flags in a distributed manner. When test execution triggers discovery, this results in all CLI flags for all modules being loaded, even though they are not being tested. If any tests or tested code trigger abseil's flag parsing, I get exceptions as I won't have passed in values for mandatory flags values from unrelated modules.
I tried commenting out the line above, which indeed solved my issue. I then opted out of
pythonTestAdapter
experiment as a better solution.This brings me to the ultimate question of what this line is trying to achieve. I first thought that this might be in case I triggered tests from the top level directory, but I can see this still results in all test ids being explicitly passed in. Am I missing a use case for this behaviour and/or some implicit side effects of running discovery? Or could this be removed/made optional?
FWIW, my python unittest args are as follows to enable all tests to be discovered. Perhaps I'm missing a trick there.
Beta Was this translation helpful? Give feedback.
All reactions