Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mute unit test discovery failure when test files are not syntactically correct #704

Closed
scottbilas opened this issue Feb 4, 2018 · 1 comment · Fixed by #1133
Closed
Assignees
Labels
area-testing feature-request Request for new features or functionality
Milestone

Comments

@scottbilas
Copy link

Environment data

VS Code version: 1.19.3
Python Extension version: 2018.1.0
Python Version: 3.6.4
OS and version: Windows 10 x64 Pro v1709

Actual behavior

I tend to save often, not just to back up work, but also to get updates from the background linter - I'm watching for the squiggly lines under text that tell me what obvious thing I broke.

Frequently, I happen to save at a time when the script won't even compile. This in turn can trigger the "[Error] There were some errors in discovering unit tests" banner, which is not only distracting, but also obscures nearly all of the tabs of my open files. I can hit ESC to get rid of it, but it comes back so often that I'm developing a weird twitch.

Expected behavior

It would be super useful to have a way to mute the banner in my settings. I don't even think it's all that useful to me anyway, given that I can see any failures during discovery in the same output window I'll be paying attention to when I run the tests.

Perhaps a "python.unitTest.suppressDiscoveringTestsWarning", similar in spirit to the suppression options I see for gitlens, csharp and lldb. Bonus points for adding a "don't show this again" option to the error banner.

(Is there already a way to do this? I've poked around and was unable to find anything.)

Steps to reproduce:

  1. Create a Python project with unit tests, and enable tests (I happen to be using "python.unitTest.pyTestEnabled": true in this workspace.
  2. Edit a test file, or an import of a test file, and introduce a syntax error
  3. Ctrl-S
  4. The UI error banner will appear and won't go away until ESC or click "Close"
  5. Repeat again and again
  6. Develop twitch
@DonJayamanne DonJayamanne self-assigned this Feb 4, 2018
@DonJayamanne DonJayamanne added feature-request Request for new features or functionality area-testing awaiting 1-decision labels Feb 4, 2018
@DonJayamanne DonJayamanne added this to the March 2018 milestone Mar 2, 2018
@DonJayamanne
Copy link

@brettcannon

DonJayamanne added a commit that referenced this issue Mar 22, 2018
…il in response to changes to files (#1133)

* do not display discovery errors when auto rediscovering tests
* 📝 news entry
* code review changes [skip ci]
* Fixes #704
@brettcannon brettcannon changed the title Unit test discovery failure could use a mute option Mute unit test discovery failure when test files are not syntactically correct Mar 27, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Jul 11, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-testing feature-request Request for new features or functionality
Projects
None yet
3 participants