fix: support pytest11 plugin fixtures from workspace editables in lsp#90
Conversation
Add is_plugin flag to FixtureDefinition and track plugin fixture files. Update resolver, scanner, and diagnostics to recognize fixtures from pytest11 entry point plugins in workspace-local editable installs. Add comprehensive tests for plugin fixture discovery, resolution, availability, and priority over third-party fixtures.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #90 +/- ##
==========================================
+ Coverage 55.45% 56.93% +1.48%
==========================================
Files 26 26
Lines 3035 3086 +51
==========================================
+ Hits 1683 1757 +74
+ Misses 1352 1329 -23 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Fixing panic on Windows.
There was a problem hiding this comment.
Pull request overview
This PR fixes LSP fixture visibility for pytest plugins registered via pytest11 entry points when the plugin is provided by a workspace-local editable install (so fixtures show up consistently in hover/definition/completions/diagnostics, matching the CLI behavior).
Changes:
- Add
is_plugintoFixtureDefinitionand track “plugin fixture files” discovered via pytest11 entry points. - Extend scanner/import scanning to mark plugin files (and propagate plugin status transitively), and extend resolver priority rules to include workspace-local plugin fixtures (Priority 2.5).
- Add comprehensive tests covering discovery, resolution, availability, priority vs conftest, and diagnostics behavior.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_lsp.rs | Updates fixture struct literals to include the new is_plugin field. |
| tests/test_fixtures.rs | Adds end-to-end and focused tests for workspace-editable pytest11 plugin fixture discovery/resolution/availability/priority. |
| src/fixtures/undeclared.rs | Treats plugin fixtures as “available” to avoid false undeclared diagnostics. |
| src/fixtures/types.rs | Adds is_plugin field to FixtureDefinition. |
| src/fixtures/scanner.rs | Marks plugin files discovered via pytest11 entry points; propagates plugin status to imported modules; increases plugin directory scan depth. |
| src/fixtures/resolver.rs | Adds Priority 2.5 resolution/availability for non-third-party plugin fixtures. |
| src/fixtures/mod.rs | Adds plugin_fixture_files to FixtureDatabase. |
| src/fixtures/analyzer.rs | Sets FixtureDefinition.is_plugin based on whether the analyzed file is marked as a plugin file. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Clarify comments and code to reflect plugin fixtures as priority 3 and third-party as priority 4, matching project documentation.
The lsp doesn't match fixtures from plugins installed from the current workspace via pytest11 entrypoints. But it works in the CLI fixtures list command.
Add is_plugin flag to FixtureDefinition and track plugin fixture files.
Update resolver, scanner, and diagnostics to recognize fixtures from pytest11 entry point plugins in workspace-local editable installs.
Add comprehensive tests for plugin fixture discovery, resolution, availability, and priority over third-party fixtures.