Skip to content

test: add missing test coverage for PRs #327, #367#459

Open
edvilme wants to merge 6 commits intomicrosoft:mainfrom
edvilme:phase2-test-coverage
Open

test: add missing test coverage for PRs #327, #367#459
edvilme wants to merge 6 commits intomicrosoft:mainfrom
edvilme:phase2-test-coverage

Conversation

@edvilme
Copy link
Copy Markdown
Contributor

@edvilme edvilme commented Apr 1, 2026

Summary

Adds missing test coverage for merged PRs, as tracked by #458.

Part of the cross-repo test coverage initiative: microsoft/vscode-python-tools-extension-template#290

Tests added

PR #327 — ignorePatterns from global settings

  • test_global_defaults.py: Verifies _get_global_defaults() reads ignorePatterns from GLOBAL_SETTINGS; covers showNotifications and importStrategy fallback paths

PR #367 — Pygls 2 API migration

  • test_logging.py: Verifies logging helpers use Pygls 2 window_log_message/window_show_message APIs; tests LS_SHOW_NOTIFICATION gating levels (off, onError, onWarning, always)

Skipped PRs

PR Reason
#336 (debounce restarts) Key functions not exported; debouncing logic embedded in activate() lifecycle
#401 (concurrent restart fix) Would require extensive LanguageClient mocking beyond existing patterns
#428 (contextlib.suppress) Behavioral no-op (refactor only)
#434 (python-environments npm) Implementation detail; existing tests already cover behavior

Refs #458

edvilme and others added 2 commits March 31, 2026 19:43
…crosoft#458, relates to microsoft#327)

Verify that _get_global_defaults() reads ignorePatterns from GLOBAL_SETTINGS
instead of always returning an empty list. Also covers showNotifications
and importStrategy global settings fallback paths.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
microsoft#458, relates to microsoft#367)

Verify that log_to_output, log_error, log_warning, and log_always use
the Pygls 2 window_log_message/window_show_message APIs. Tests cover
all LS_SHOW_NOTIFICATION gating levels (off, onError, onWarning, always)
to ensure notification popups are shown at the correct thresholds.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@edvilme edvilme added the debt label Apr 1, 2026
@edvilme edvilme changed the title test: add missing test coverage for PRs #327 and #367 (refs #458) test: add missing test coverage for PRs #327, #367 Apr 1, 2026
- Extract duplicated _setup_mocks() into conftest.py with session teardown
- Unify _FlexClass (kwargs-storing variant) to eliminate subtle divergence
- Replace _patch_lsp_server() with patched_lsp_server fixture using
  patch.object for automatic restoration (fixes state leak between tests)
- Use real lsp_utils/lsp_jsonrpc from bundled/tool instead of partial mocks

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@edvilme edvilme requested a review from rchiodo April 1, 2026 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants