Skip to content

test: add missing test coverage for PRs #325, #347, #357, #467#498

Merged
edvilme merged 9 commits intomainfrom
phase2-test-coverage
Apr 7, 2026
Merged

test: add missing test coverage for PRs #325, #347, #357, #467#498
edvilme merged 9 commits intomainfrom
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 #496.

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

Tests added

PR #357 — nearestConfig searches more config files

  • test_get_cwd.py: Finds .mypy.ini, pyproject.toml, and setup.cfg (not just mypy.ini); prefers closest config file

PR #325 — ignorePatterns from global settings

  • test_global_defaults.py: Verifies _get_global_defaults() reads ignorePatterns from GLOBAL_SETTINGS

PR #347 — daemonStatusFile setting

  • test_dmypy_status_file.py: _get_dmypy_args() uses custom daemonStatusFile when set, auto-generates when empty, caches per workspace
  • settings.unit.test.ts: checkIfConfigurationChanged detects daemonStatusFile changes; getWorkspaceSettings returns property

PR #467 — PythonEnvironments.api() migration

  • python.unit.test.ts: Resolves interpreter via PythonEnvironments.api(); falls back to legacy API when unavailable

Skipped PRs

PR Reason
#342, #344 (Windows path casing) Platform-specific, untestable on CI
#346 (debounce/deduplication) Core functions not exported
#375 (stderr parsing) Tightly coupled to LSP server
#442 (disposables cleanup) Coupled to VS Code internals
#470 (contextlib.suppress) Pure refactor, no behavioral change

Refs #496

edvilme and others added 5 commits March 31, 2026 19:47
…setup.cfg (refs #496, relates to #357)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…rns and daemonStatusFile (refs #496, relates to #325, #347)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… relates to #347)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…figurationChanged (refs #496, relates to #347)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…n (refs #496, relates to #467)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@edvilme edvilme added the debt Technical debt or repo cleanup label Apr 1, 2026
…eanup

- Add normalize_path to mock_lsp_utils in test_global_defaults.py
- Add fallback guard ensuring normalize_path is set even if lsp_utils
  was mocked by another test file first
- Wrap dmypy status file test bodies in try/finally so _clear_dmypy_cache()
  runs even when assertions fail

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Remove unused imports (PythonEnvironmentApi, commands, Disposable, Event)
- Add explicit envsApiStub.calledOnce assertion in fallback test
- Change let workspace1 to const (2 occurrences)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@edvilme edvilme requested a review from rchiodo April 7, 2026 16:50
Copy link
Copy Markdown

@rchiodo rchiodo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved via Review Center.

@edvilme edvilme merged commit 50b5bf7 into main Apr 7, 2026
21 checks passed
@edvilme edvilme deleted the phase2-test-coverage branch April 7, 2026 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

debt Technical debt or repo cleanup

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants