Replies: 2 comments 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.
-
Hello @eleanorjboyd, edit: it turns out I can revert to the ms-python.python I seem to be running into the same issue again, since an auto-update on our company's side (i.e. I can't back out to an older version). In all cases I can see test discovery running prior to test execution, using the new python test adapter, which triggers the aforementioned issues. Unfortunately disabling the experiment no longer changes anything, and a quick browse of the VScode repo seems to suggest it has switched over to the new test running approach altogether. Do you have any suggestions as-to how I can avoid this pattern of discovery as part of test execution? Thanks, |
Beta Was this translation helpful? Give feedback.
-
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