-
Notifications
You must be signed in to change notification settings - Fork 261
impl LSP: Navigation support for pytest fixtures #1901 #2075
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR implements LSP navigation support for pytest fixtures, enabling go-to-definition and find-references functionality for fixture parameters in test functions. When a developer invokes go-to-definition on a fixture parameter (e.g., my_fixture in def test_thing(my_fixture):), the LSP will navigate to the fixture definition. Similarly, finding references on a fixture definition will include all test/fixture functions that use it as a parameter.
Changes:
- Added pytest import and fixture detection logic to identify pytest modules and fixture decorators
- Implemented fixture discovery and parameter scanning to collect fixture definitions and their usage in test functions
- Integrated pytest fixture resolution into LSP go-to-definition and find-references operations
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| pyrefly/lib/state/lsp.rs | Core implementation: added PytestAliases tracking, fixture detection functions, and integrated pytest-aware parameter resolution into LSP operations |
| pyrefly/lib/test/lsp/definition.rs | Added test verifying go-to-definition navigation from fixture parameters to fixture definitions |
| pyrefly/lib/test/lsp/local_find_refs.rs | Added test verifying find-references includes injected fixture parameters in test functions |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This comment has been minimized.
This comment has been minimized.
for sure. maybe a pyrefly/lib/third_party or something similar? |
This comment has been minimized.
This comment has been minimized.
| @@ -156,6 +156,34 @@ Definition Result: | |||
| ); | |||
| } | |||
|
|
|||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A more high level comment/question is, do we want to add type support? or is this exclusively an IDE feature? For example, it would be great if the following worked:
from typing import reveal_type
import pytest
@pytest.fixture
def my_fixture() -> int:
return 42
def test_foo(my_fixture):
reveal_type(my_fixture) # int
That would require extending the binding layer.
Additionally, how would conftest.py fit into this support? Overall, I think there are some open questions when it comes to this feature.
On a different note, I would also say that attr support could be a nice problem to look at (if you are specifically interested in 3p support!)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we want to add type support
#2201 I think it's here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking more like what we're doing for pydantic and django in the binding layer. Was curious why we didn't follow that direction.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pytest fixtures here are only used to improve navigation (definition/refs) in the LSP, not typing.
The LSP path already has AST access and is allowed to do local scans. Avoiding extra binding state keeps the feature isolated
For now, it’s a tradeoff compared to adding new binding data structures and incremental update logic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And add typing will be too big for a single pr?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the improvements! the diff is looking much better. Let me discuss with the team those tradeoffs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I discussed with the team. I think this tradeoff between storing data in the binding layer vs the lsp layer is still open. We need to better understand the perf implications of this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
now it bind to types
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
https://stackoverflow.com/questions/77318902/why-using-yield-instead-of-return-in-pytest-fixtures aa, not only return but yield |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Diff from mypy_primer, showing the effect of this PR on open source code: scrapy (https://github.com/scrapy/scrapy)
+ ERROR tests/test_engine.py:534:9-33: Object of class `NoneType` has no attribute `add_request` [missing-attribute]
+ ERROR tests/test_engine.py:535:9-36: Object of class `NoneType` has no attribute `remove_request` [missing-attribute]
+ ERROR tests/test_engine.py:539:9-33: Object of class `NoneType` has no attribute `add_request` [missing-attribute]
+ ERROR tests/test_engine.py:540:9-36: Object of class `NoneType` has no attribute `remove_request` [missing-attribute]
+ ERROR tests/test_engine.py:556:9-33: Object of class `NoneType` has no attribute `add_request` [missing-attribute]
+ ERROR tests/test_engine.py:557:9-36: Object of class `NoneType` has no attribute `remove_request` [missing-attribute]
+ ERROR tests/test_engine.py:562:9-33: Object of class `NoneType` has no attribute `add_request` [missing-attribute]
+ ERROR tests/test_engine.py:565:9-36: Object of class `NoneType` has no attribute `remove_request` [missing-attribute]
+ ERROR tests/test_engine.py:584:9-33: Object of class `NoneType` has no attribute `add_request` [missing-attribute]
+ ERROR tests/test_engine.py:585:9-36: Object of class `NoneType` has no attribute `remove_request` [missing-attribute]
+ ERROR tests/test_engine.py:589:9-33: Object of class `NoneType` has no attribute `add_request` [missing-attribute]
+ ERROR tests/test_engine.py:590:9-36: Object of class `NoneType` has no attribute `remove_request` [missing-attribute]
+ ERROR tests/test_utils_misc/test_return_with_argument_inside_generator.py:97:49-60: Argument `TestUtilsMisc.mock_spider.MockSpider` is not assignable to parameter `spider` with type `Spider` in function `scrapy.utils.misc.warn_on_generator_with_return_value` [bad-argument-type]
+ ERROR tests/test_utils_misc/test_return_with_argument_inside_generator.py:104:49-60: Argument `TestUtilsMisc.mock_spider.MockSpider` is not assignable to parameter `spider` with type `Spider` in function `scrapy.utils.misc.warn_on_generator_with_return_value` [bad-argument-type]
+ ERROR tests/test_utils_misc/test_return_with_argument_inside_generator.py:108:49-60: Argument `TestUtilsMisc.mock_spider.MockSpider` is not assignable to parameter `spider` with type `Spider` in function `scrapy.utils.misc.warn_on_generator_with_return_value` [bad-argument-type]
+ ERROR tests/test_utils_misc/test_return_with_argument_inside_generator.py:112:49-60: Argument `TestUtilsMisc.mock_spider.MockSpider` is not assignable to parameter `spider` with type `Spider` in function `scrapy.utils.misc.warn_on_generator_with_return_value` [bad-argument-type]
+ ERROR tests/test_utils_misc/test_return_with_argument_inside_generator.py:116:49-60: Argument `TestUtilsMisc.mock_spider.MockSpider` is not assignable to parameter `spider` with type `Spider` in function `scrapy.utils.misc.warn_on_generator_with_return_value` [bad-argument-type]
+ ERROR tests/test_utils_misc/test_return_with_argument_inside_generator.py:164:49-60: Argument `TestUtilsMisc.mock_spider.MockSpider` is not assignable to parameter `spider` with type `Spider` in function `scrapy.utils.misc.warn_on_generator_with_return_value` [bad-argument-type]
+ ERROR tests/test_utils_misc/test_return_with_argument_inside_generator.py:167:49-60: Argument `TestUtilsMisc.mock_spider.MockSpider` is not assignable to parameter `spider` with type `Spider` in function `scrapy.utils.misc.warn_on_generator_with_return_value` [bad-argument-type]
+ ERROR tests/test_utils_misc/test_return_with_argument_inside_generator.py:170:49-60: Argument `TestUtilsMisc.mock_spider.MockSpider` is not assignable to parameter `spider` with type `Spider` in function `scrapy.utils.misc.warn_on_generator_with_return_value` [bad-argument-type]
+ ERROR tests/test_utils_misc/test_return_with_argument_inside_generator.py:173:49-60: Argument `TestUtilsMisc.mock_spider.MockSpider` is not assignable to parameter `spider` with type `Spider` in function `scrapy.utils.misc.warn_on_generator_with_return_value` [bad-argument-type]
+ ERROR tests/test_utils_misc/test_return_with_argument_inside_generator.py:176:49-60: Argument `TestUtilsMisc.mock_spider.MockSpider` is not assignable to parameter `spider` with type `Spider` in function `scrapy.utils.misc.warn_on_generator_with_return_value` [bad-argument-type]
+ ERROR tests/test_utils_misc/test_return_with_argument_inside_generator.py:179:49-60: Argument `TestUtilsMisc.mock_spider.MockSpider` is not assignable to parameter `spider` with type `Spider` in function `scrapy.utils.misc.warn_on_generator_with_return_value` [bad-argument-type]
+ ERROR tests/test_utils_misc/test_return_with_argument_inside_generator.py:182:49-60: Argument `TestUtilsMisc.mock_spider.MockSpider` is not assignable to parameter `spider` with type `Spider` in function `scrapy.utils.misc.warn_on_generator_with_return_value` [bad-argument-type]
+ ERROR tests/test_utils_misc/test_return_with_argument_inside_generator.py:185:49-60: Argument `TestUtilsMisc.mock_spider.MockSpider` is not assignable to parameter `spider` with type `Spider` in function `scrapy.utils.misc.warn_on_generator_with_return_value` [bad-argument-type]
+ ERROR tests/test_utils_misc/test_return_with_argument_inside_generator.py:245:49-60: Argument `TestUtilsMisc.mock_spider.MockSpider` is not assignable to parameter `spider` with type `Spider` in function `scrapy.utils.misc.warn_on_generator_with_return_value` [bad-argument-type]
+ ERROR tests/test_utils_misc/test_return_with_argument_inside_generator.py:248:49-60: Argument `TestUtilsMisc.mock_spider.MockSpider` is not assignable to parameter `spider` with type `Spider` in function `scrapy.utils.misc.warn_on_generator_with_return_value` [bad-argument-type]
+ ERROR tests/test_utils_misc/test_return_with_argument_inside_generator.py:251:49-60: Argument `TestUtilsMisc.mock_spider.MockSpider` is not assignable to parameter `spider` with type `Spider` in function `scrapy.utils.misc.warn_on_generator_with_return_value` [bad-argument-type]
+ ERROR tests/test_utils_misc/test_return_with_argument_inside_generator.py:254:49-60: Argument `TestUtilsMisc.mock_spider.MockSpider` is not assignable to parameter `spider` with type `Spider` in function `scrapy.utils.misc.warn_on_generator_with_return_value` [bad-argument-type]
+ ERROR tests/test_utils_misc/test_return_with_argument_inside_generator.py:257:49-60: Argument `TestUtilsMisc.mock_spider.MockSpider` is not assignable to parameter `spider` with type `Spider` in function `scrapy.utils.misc.warn_on_generator_with_return_value` [bad-argument-type]
+ ERROR tests/test_utils_misc/test_return_with_argument_inside_generator.py:260:49-60: Argument `TestUtilsMisc.mock_spider.MockSpider` is not assignable to parameter `spider` with type `Spider` in function `scrapy.utils.misc.warn_on_generator_with_return_value` [bad-argument-type]
+ ERROR tests/test_utils_misc/test_return_with_argument_inside_generator.py:263:49-60: Argument `TestUtilsMisc.mock_spider.MockSpider` is not assignable to parameter `spider` with type `Spider` in function `scrapy.utils.misc.warn_on_generator_with_return_value` [bad-argument-type]
+ ERROR tests/test_utils_misc/test_return_with_argument_inside_generator.py:266:49-60: Argument `TestUtilsMisc.mock_spider.MockSpider` is not assignable to parameter `spider` with type `Spider` in function `scrapy.utils.misc.warn_on_generator_with_return_value` [bad-argument-type]
+ ERROR tests/test_utils_misc/test_return_with_argument_inside_generator.py:274:49-60: Argument `TestUtilsMisc.mock_spider.MockSpider` is not assignable to parameter `spider` with type `Spider` in function `scrapy.utils.misc.warn_on_generator_with_return_value` [bad-argument-type]
+ ::error file=tests/test_engine.py,line=534,col=9,endLine=534,endColumn=33,title=Pyrefly missing-attribute::Object of class `NoneType` has no attribute `add_request`
+ ::error file=tests/test_engine.py,line=535,col=9,endLine=535,endColumn=36,title=Pyrefly missing-attribute::Object of class `NoneType` has no attribute `remove_request`
+ ::error file=tests/test_engine.py,line=539,col=9,endLine=539,endColumn=33,title=Pyrefly missing-attribute::Object of class `NoneType` has no attribute `add_request`
+ ::error file=tests/test_engine.py,line=540,col=9,endLine=540,endColumn=36,title=Pyrefly missing-attribute::Object of class `NoneType` has no attribute `remove_request`
+ ::error file=tests/test_engine.py,line=556,col=9,endLine=556,endColumn=33,title=Pyrefly missing-attribute::Object of class `NoneType` has no attribute `add_request`
+ ::error file=tests/test_engine.py,line=557,col=9,endLine=557,endColumn=36,title=Pyrefly missing-attribute::Object of class `NoneType` has no attribute `remove_request`
+ ::error file=tests/test_engine.py,line=562,col=9,endLine=562,endColumn=33,title=Pyrefly missing-attribute::Object of class `NoneType` has no attribute `add_request`
+ ::error file=tests/test_engine.py,line=565,col=9,endLine=565,endColumn=36,title=Pyrefly missing-attribute::Object of class `NoneType` has no attribute `remove_request`
+ ::error file=tests/test_engine.py,line=584,col=9,endLine=584,endColumn=33,title=Pyrefly missing-attribute::Object of class `NoneType` has no attribute `add_request`
+ ::error file=tests/test_engine.py,line=585,col=9,endLine=585,endColumn=36,title=Pyrefly missing-attribute::Object of class `NoneType` has no attribute `remove_request`
+ ::error file=tests/test_engine.py,line=589,col=9,endLine=589,endColumn=33,title=Pyrefly missing-attribute::Object of class `NoneType` has no attribute `add_request`
+ ::error file=tests/test_engine.py,line=590,col=9,endLine=590,endColumn=36,title=Pyrefly missing-attribute::Object of class `NoneType` has no attribute `remove_request`
+ ::error file=tests/test_utils_misc/test_return_with_argument_inside_generator.py,line=97,col=49,endLine=97,endColumn=60,title=Pyrefly bad-argument-type::Argument `TestUtilsMisc.mock_spider.MockSpider` is not assignable to parameter `spider` with type `Spider` in function `scrapy.utils.misc.warn_on_generator_with_return_value`
+ ::error file=tests/test_utils_misc/test_return_with_argument_inside_generator.py,line=104,col=49,endLine=104,endColumn=60,title=Pyrefly bad-argument-type::Argument `TestUtilsMisc.mock_spider.MockSpider` is not assignable to parameter `spider` with type `Spider` in function `scrapy.utils.misc.warn_on_generator_with_return_value`
+ ::error file=tests/test_utils_misc/test_return_with_argument_inside_generator.py,line=108,col=49,endLine=108,endColumn=60,title=Pyrefly bad-argument-type::Argument `TestUtilsMisc.mock_spider.MockSpider` is not assignable to parameter `spider` with type `Spider` in function `scrapy.utils.misc.warn_on_generator_with_return_value`
+ ::error file=tests/test_utils_misc/test_return_with_argument_inside_generator.py,line=112,col=49,endLine=112,endColumn=60,title=Pyrefly bad-argument-type::Argument `TestUtilsMisc.mock_spider.MockSpider` is not assignable to parameter `spider` with type `Spider` in function `scrapy.utils.misc.warn_on_generator_with_return_value`
+ ::error file=tests/test_utils_misc/test_return_with_argument_inside_generator.py,line=116,col=49,endLine=116,endColumn=60,title=Pyrefly bad-argument-type::Argument `TestUtilsMisc.mock_spider.MockSpider` is not assignable to parameter `spider` with type `Spider` in function `scrapy.utils.misc.warn_on_generator_with_return_value`
+ ::error file=tests/test_utils_misc/test_return_with_argument_inside_generator.py,line=164,col=49,endLine=164,endColumn=60,title=Pyrefly bad-argument-type::Argument `TestUtilsMisc.mock_spider.MockSpider` is not assignable to parameter `spider` with type `Spider` in function `scrapy.utils.misc.warn_on_generator_with_return_value`
+ ::error file=tests/test_utils_misc/test_return_with_argument_inside_generator.py,line=167,col=49,endLine=167,endColumn=60,title=Pyrefly bad-argument-type::Argument `TestUtilsMisc.mock_spider.MockSpider` is not assignable to parameter `spider` with type `Spider` in function `scrapy.utils.misc.warn_on_generator_with_return_value`
+ ::error file=tests/test_utils_misc/test_return_with_argument_inside_generator.py,line=170,col=49,endLine=170,endColumn=60,title=Pyrefly bad-argument-type::Argument `TestUtilsMisc.mock_spider.MockSpider` is not assignable to parameter `spider` with type `Spider` in function `scrapy.utils.misc.warn_on_generator_with_return_value`
+ ::error file=tests/test_utils_misc/test_return_with_argument_inside_generator.py,line=173,col=49,endLine=173,endColumn=60,title=Pyrefly bad-argument-type::Argument `TestUtilsMisc.mock_spider.MockSpider` is not assignable to parameter `spider` with type `Spider` in function `scrapy.utils.misc.warn_on_generator_with_return_value`
+ ::error file=tests/test_utils_misc/test_return_with_argument_inside_generator.py,line=176,col=49,endLine=176,endColumn=60,title=Pyrefly bad-argument-type::Argument `TestUtilsMisc.mock_spider.MockSpider` is not assignable to parameter `spider` with type `Spider` in function `scrapy.utils.misc.warn_on_generator_with_return_value`
+ ::error file=tests/test_utils_misc/test_return_with_argument_inside_generator.py,line=179,col=49,endLine=179,endColumn=60,title=Pyrefly bad-argument-type::Argument `TestUtilsMisc.mock_spider.MockSpider` is not assignable to parameter `spider` with type `Spider` in function `scrapy.utils.misc.warn_on_generator_with_return_value`
+ ::error file=tests/test_utils_misc/test_return_with_argument_inside_generator.py,line=182,col=49,endLine=182,endColumn=60,title=Pyrefly bad-argument-type::Argument `TestUtilsMisc.mock_spider.MockSpider` is not assignable to parameter `spider` with type `Spider` in function `scrapy.utils.misc.warn_on_generator_with_return_value`
+ ::error file=tests/test_utils_misc/test_return_with_argument_inside_generator.py,line=185,col=49,endLine=185,endColumn=60,title=Pyrefly bad-argument-type::Argument `TestUtilsMisc.mock_spider.MockSpider` is not assignable to parameter `spider` with type `Spider` in function `scrapy.utils.misc.warn_on_generator_with_return_value`
+ ::error file=tests/test_utils_misc/test_return_with_argument_inside_generator.py,line=245,col=49,endLine=245,endColumn=60,title=Pyrefly bad-argument-type::Argument `TestUtilsMisc.mock_spider.MockSpider` is not assignable to parameter `spider` with type `Spider` in function `scrapy.utils.misc.warn_on_generator_with_return_value`
+ ::error file=tests/test_utils_misc/test_return_with_argument_inside_generator.py,line=248,col=49,endLine=248,endColumn=60,title=Pyrefly bad-argument-type::Argument `TestUtilsMisc.mock_spider.MockSpider` is not assignable to parameter `spider` with type `Spider` in function `scrapy.utils.misc.warn_on_generator_with_return_value`
+ ::error file=tests/test_utils_misc/test_return_with_argument_inside_generator.py,line=251,col=49,endLine=251,endColumn=60,title=Pyrefly bad-argument-type::Argument `TestUtilsMisc.mock_spider.MockSpider` is not assignable to parameter `spider` with type `Spider` in function `scrapy.utils.misc.warn_on_generator_with_return_value`
+ ::error file=tests/test_utils_misc/test_return_with_argument_inside_generator.py,line=254,col=49,endLine=254,endColumn=60,title=Pyrefly bad-argument-type::Argument `TestUtilsMisc.mock_spider.MockSpider` is not assignable to parameter `spider` with type `Spider` in function `scrapy.utils.misc.warn_on_generator_with_return_value`
+ ::error file=tests/test_utils_misc/test_return_with_argument_inside_generator.py,line=257,col=49,endLine=257,endColumn=60,title=Pyrefly bad-argument-type::Argument `TestUtilsMisc.mock_spider.MockSpider` is not assignable to parameter `spider` with type `Spider` in function `scrapy.utils.misc.warn_on_generator_with_return_value`
+ ::error file=tests/test_utils_misc/test_return_with_argument_inside_generator.py,line=260,col=49,endLine=260,endColumn=60,title=Pyrefly bad-argument-type::Argument `TestUtilsMisc.mock_spider.MockSpider` is not assignable to parameter `spider` with type `Spider` in function `scrapy.utils.misc.warn_on_generator_with_return_value`
+ ::error file=tests/test_utils_misc/test_return_with_argument_inside_generator.py,line=263,col=49,endLine=263,endColumn=60,title=Pyrefly bad-argument-type::Argument `TestUtilsMisc.mock_spider.MockSpider` is not assignable to parameter `spider` with type `Spider` in function `scrapy.utils.misc.warn_on_generator_with_return_value`
+ ::error file=tests/test_utils_misc/test_return_with_argument_inside_generator.py,line=266,col=49,endLine=266,endColumn=60,title=Pyrefly bad-argument-type::Argument `TestUtilsMisc.mock_spider.MockSpider` is not assignable to parameter `spider` with type `Spider` in function `scrapy.utils.misc.warn_on_generator_with_return_value`
... (truncated 1 lines) ...
cloud-init (https://github.com/canonical/cloud-init)
+ ERROR tests/unittests/analyze/test_show.py:21:9-23: Object of class `tuple` has no attribute `infile` [missing-attribute]
+ ERROR tests/unittests/analyze/test_show.py:23:38-45: Argument `tuple[Any, ...]` is not assignable to parameter `args` with type `Namespace` in function `cloudinit.analyze.analyze_show` [bad-argument-type]
+ ERROR tests/unittests/analyze/test_show.py:24:57-71: Object of class `tuple` has no attribute `infile` [missing-attribute]
+ ERROR tests/unittests/config/test_cc_install_hotplug.py:49:9-22: Object of class `tuple` has no attribute `m_which` [missing-attribute]
+ ERROR tests/unittests/config/test_cc_install_hotplug.py:50:9-31: Object of class `tuple` has no attribute `m_update_enabled` [missing-attribute]
+ ERROR tests/unittests/config/test_cc_install_hotplug.py:63:13-26: Object of class `tuple` has no attribute `m_write` [missing-attribute]
+ ERROR tests/unittests/config/test_cc_install_hotplug.py:69:16-28: Object of class `tuple` has no attribute `m_subp` [missing-attribute]
+ ERROR tests/unittests/config/test_cc_install_hotplug.py:78:16-27: Object of class `tuple` has no attribute `m_del` [missing-attribute]
+ ERROR tests/unittests/config/test_cc_install_hotplug.py:81:9-31: Object of class `tuple` has no attribute `m_update_enabled` [missing-attribute]
+ ERROR tests/unittests/config/test_cc_install_hotplug.py:86:16-29: Object of class `tuple` has no attribute `m_write` [missing-attribute]
+ ERROR tests/unittests/config/test_cc_install_hotplug.py:87:16-27: Object of class `tuple` has no attribute `m_del` [missing-attribute]
+ ERROR tests/unittests/config/test_cc_install_hotplug.py:88:16-28: Object of class `tuple` has no attribute `m_subp` [missing-attribute]
+ ERROR tests/unittests/config/test_cc_install_hotplug.py:91:9-31: Object of class `tuple` has no attribute `m_update_enabled` [missing-attribute]
+ ERROR tests/unittests/config/test_cc_install_hotplug.py:98:16-29: Object of class `tuple` has no attribute `m_write` [missing-attribute]
+ ERROR tests/unittests/config/test_cc_install_hotplug.py:99:16-27: Object of class `tuple` has no attribute `m_del` [missing-attribute]
+ ERROR tests/unittests/config/test_cc_install_hotplug.py:100:16-28: Object of class `tuple` has no attribute `m_subp` [missing-attribute]
+ ERROR tests/unittests/config/test_cc_install_hotplug.py:103:9-28: Object of class `tuple` has no attribute `m_path_exists` [missing-attribute]
+ ERROR tests/unittests/config/test_cc_install_hotplug.py:104:9-31: Object of class `tuple` has no attribute `m_update_enabled` [missing-attribute]
+ ERROR tests/unittests/config/test_cc_install_hotplug.py:109:9-20: Object of class `tuple` has no attribute `m_del` [missing-attribute]
+ ERROR tests/unittests/config/test_cc_install_hotplug.py:110:16-28: Object of class `tuple` has no attribute `m_subp` [missing-attribute]
+ ERROR tests/unittests/config/test_cc_install_hotplug.py:119:16-29: Object of class `tuple` has no attribute `m_write` [missing-attribute]
+ ERROR tests/unittests/config/test_cc_install_hotplug.py:122:9-31: Object of class `tuple` has no attribute `m_update_enabled` [missing-attribute]
+ ERROR tests/unittests/config/test_cc_install_hotplug.py:129:16-27: Object of class `tuple` has no attribute `m_del` [missing-attribute]
+ ERROR tests/unittests/config/test_cc_install_hotplug.py:130:16-29: Object of class `tuple` has no attribute `m_write` [missing-attribute]
+ ERROR tests/unittests/config/test_cc_install_hotplug.py:131:16-28: Object of class `tuple` has no attribute `m_subp` [missing-attribute]
+ ERROR tests/unittests/config/test_cc_install_hotplug.py:134:9-22: Object of class `tuple` has no attribute `m_which` [missing-attribute]
+ ERROR tests/unittests/config/test_cc_install_hotplug.py:135:9-31: Object of class `tuple` has no attribute `m_update_enabled` [missing-attribute]
+ ERROR tests/unittests/config/test_cc_install_hotplug.py:158:9-22: Object of class `tuple` has no attribute `m_write` [missing-attribute]
+ ERROR tests/unittests/config/test_cc_install_hotplug.py:162:16-28: Object of class `tuple` has no attribute `m_subp` [missing-attribute]
+ ERROR tests/unittests/config/test_cc_install_hotplug.py:171:16-27: Object of class `tuple` has no attribute `m_del` [missing-attribute]
+ ERROR tests/unittests/distros/test_debian.py:149:57-64: Unexpected keyword argument `keyname` in function `cloudinit.distros.Distro.apply_locale` [unexpected-keyword]
+ ERROR tests/unittests/runs/test_simple_run.py:203:37-41: `None` is not assignable to TypedDict key `cloud_init_modules` with type `list[str]` [bad-typed-dict-key]
+ ERROR tests/unittests/sources/test_azure.py:1018:35-51: `dict[str, dict[str, list[dict[str, str | dict[str, list[Unknown]] | dict[str, list[dict[str, str]]]]]] | dict[str, list[dict[str, str]] | str]]` is not assignable to attribute `_metadata_imds` with type `str` [bad-assignment]
+ ERROR tests/unittests/sources/test_azure.py:1025:9-48: Cannot set item in `None` [unsupported-operation]
+ ERROR tests/unittests/sources/test_azure.py:1026:35-51: `dict[str, dict[str, list[dict[str, str | dict[str, list[Unknown]] | dict[str, list[dict[str, str]]]]]] | dict[str, list[dict[str, str]] | str]]` is not assignable to attribute `_metadata_imds` with type `str` [bad-assignment]
+ ERROR tests/unittests/sources/test_azure.py:1051:35-73: `dict[str, dict[str, list[dict[str, str | dict[str, list[Unknown]] | dict[str, list[dict[str, str]]]]]] | dict[str, list[dict[str, str]] | str]]` is not assignable to attribute `_metadata_imds` with type `str` [bad-assignment]
+ ERROR tests/unittests/sources/test_azure.py:1067:35-75: `dict[str, dict[str, list[dict[str, str | dict[str, list[Unknown]] | dict[str, list[dict[str, str]]]]]] | dict[str, list[dict[str, str]] | str]]` is not assignable to attribute `_metadata_imds` with type `str` [bad-assignment]
+ ERROR tests/unittests/sources/test_azure.py:1708:13-28: Object of class `NoneType` has no attribute `get` [missing-attribute]
+ ERROR tests/unittests/sources/test_azure.py:3466:16-50: Object of class `NoneType` has no attribute `iface` [missing-attribute]
+ ERROR tests/unittests/sources/test_azure.py:3493:16-50: Object of class `NoneType` has no attribute `iface` [missing-attribute]
+ ERROR tests/unittests/sources/test_azure.py:3559:16-50: Object of class `NoneType` has no attribute `iface` [missing-attribute]
+ ERROR tests/unittests/sources/test_azure.py:3718:16-50: Object of class `NoneType` has no attribute `iface` [missing-attribute]
+ ERROR tests/unittests/sources/test_azure.py:3889:16-50: Object of class `NoneType` has no attribute `iface` [missing-attribute]
+ ERROR tests/unittests/sources/test_openstack.py:423:30-41: `dict[str, list[dict[str, str]] | list[@_]]` is not assignable to attribute `network_json` with type `str | None` [bad-assignment]
+ ERROR tests/unittests/sources/test_openstack.py:437:30-41: `dict[str, list[dict[str, str]] | list[@_]]` is not assignable to attribute `network_json` with type `str | None` [bad-assignment]
+ ERROR tests/unittests/sources/test_openstack.py:448:33-44: `dict[str, int | list[Unknown]]` is not assignable to attribute `_network_config` with type `str` [bad-assignment]
+ ERROR tests/unittests/sources/test_openstack.py:505:25-46: Argument `int | str` is not assignable to parameter `obj` with type `Sized` in function `len` [bad-argument-type]
+ ERROR tests/unittests/sources/test_openstack.py:507:9-15: Object of class `int` has no attribute `pop`
+ Object of class `str` has no attribute `pop` [missing-attribute]
+ ERROR tests/unittests/sources/test_openstack.py:508:9-15: Object of class `int` has no attribute `pop`
+ Object of class `str` has no attribute `pop` [missing-attribute]
+ ERROR tests/unittests/sources/test_oracle.py:355:20-64: `None` is not subscriptable [unsupported-operation]
+ ERROR tests/unittests/sources/test_oracle.py:361:16-60: `None` is not subscriptable [unsupported-operation]
+ ERROR tests/unittests/sources/test_oracle.py:394:37-45: `object` is not assignable to attribute `_network_config` with type `dict[Unknown, Unknown]` [bad-assignment]
+ ERROR tests/unittests/sources/test_oracle.py:402:37-45: `object` is not assignable to attribute `_network_config` with type `dict[Unknown, Unknown]` [bad-assignment]
+ ERROR tests/unittests/sources/test_oracle.py:555:9-53: Cannot set item in `None` [unsupported-operation]
+ ERROR tests/unittests/sources/test_oracle.py:569:21-56: Object of class `FunctionType` has no attribute `call_count` [missing-attribute]
+ ERROR tests/unittests/sources/test_oracle.py:1409:21-59: Object of class `FunctionType` has no attribute `call_count` [missing-attribute]
+ ERROR tests/unittests/sources/test_oracle.py:1411:21-59: Object of class `FunctionType` has no attribute `call_count` [missing-attribute]
+ ERROR tests/unittests/sources/test_oracle.py:1413:21-59: Object of class `FunctionType` has no attribute `call_count` [missing-attribute]
+ ERROR tests/unittests/sources/test_oracle.py:1460:13-57: Cannot set item in `None` [unsupported-operation]
+ ERROR tests/unittests/sources/test_oracle.py:1481:9-53: Cannot set item in `None` [unsupported-operation]
+ ERROR tests/unittests/sources/test_oracle.py:1490:34-74: Object of class `FunctionType` has no attribute `return_value` [missing-attribute]
+ ERROR tests/unittests/sources/test_smartos.py:660:16-46: Object of class `NoneType` has no attribute `startswith` [missing-attribute]
+ ERROR tests/unittests/sources/test_smartos.py:865:5-35: Object of class `NoneType` has no attribute `timeout` [missing-attribute]
+ ERROR tests/unittests/sources/test_smartos.py:989:9-49: Cannot set item in `None` [unsupported-operation]
+ ERROR tests/unittests/sources/test_smartos.py:998:9-46: Cannot set item in `None` [unsupported-operation]
+ ERROR tests/unittests/sources/test_smartos.py:1007:9-53: Cannot set item in `None` [unsupported-operation]
+ ERROR tests/unittests/sources/test_smartos.py:1008:35-1010:10: `(_: Unknown) -> Unknown` is not assignable to attribute `_checksum` with type `BoundMethod[JoyentMetadataClient, (self: JoyentMetadataClient, body: Unknown) -> str]` [bad-assignment]
+ ERROR tests/unittests/sources/test_smartos.py:1008:45-1010:10: `None` is not subscriptable [unsupported-operation]
+ ERROR tests/unittests/sources/test_smartos.py:1017:9-50: Cannot set item in `None` [unsupported-operation]
+ ERROR tests/unittests/sources/test_smartos.py:1018:9-50: Cannot set item in `None` [unsupported-operation]
+ ERROR tests/unittests/sources/test_smartos.py:1019:9-49: Cannot set item in `None` [unsupported-operation]
+ ERROR tests/unittests/sources/test_smartos.py:1020:35-1022:10: `(_: Unknown) -> Unknown` is not assignable to attribute `_checksum` with type `BoundMethod[JoyentMetadataClient, (self: JoyentMetadataClient, body: Unknown) -> str]` [bad-assignment]
+ ERROR tests/unittests/sources/test_smartos.py:1020:45-1022:10: `None` is not subscriptable [unsupported-operation]
+ ERROR tests/unittests/sources/test_smartos.py:1027:9-30: Object of class `NoneType` has no attribute `read` [missing-attribute]
+ ERROR tests/unittests/sources/test_smartos.py:1034:9-30: Object of class `NoneType` has no attribute `read` [missing-attribute]
+ ERROR tests/unittests/sources/test_smartos.py:1041:9-30: Object of class `NoneType` has no attribute `read` [missing-attribute]
+ ERROR tests/unittests/sources/test_smartos.py:1044:30-51: Object of class `NoneType` has no attribute `read` [missing-attribute]
+ ERROR tests/unittests/sources/test_smartos.py:1048:9-37: Object of class `NoneType` has no attribute `read` [missing-attribute]
+ ERROR tests/unittests/sources/test_smartos.py:1056:9-37: Object of class `NoneType` has no attribute `read` [missing-attribute]
+ ERROR tests/unittests/sources/test_smartos.py:1062:9-37: Object of class `NoneType` has no attribute `read` [missing-attribute]
+ ERROR tests/unittests/sources/test_smartos.py:1069:9-50: Cannot set item in `None` [unsupported-operation]
+ ERROR tests/unittests/sources/test_smartos.py:1070:9-46: Cannot set item in `None` [unsupported-operation]
+ ERROR tests/unittests/sources/test_smartos.py:1071:9-49: Cannot set item in `None` [unsupported-operation]
+ ERROR tests/unittests/sources/test_smartos.py:1077:13-54: Cannot delete item in `None` [unsupported-operation]
+ ERROR tests/unittests/sources/test_smartos.py:1078:9-49: Cannot set item in `None` [unsupported-operation]
+ ERROR tests/unittests/sources/test_smartos.py:1079:9-46: Cannot set item in `None` [unsupported-operation]
+ ERROR tests/unittests/sources/test_upcloud.py:270:25-49: Argument `str | Unknown | None` is not assignable to parameter `obj` with type `Sized` in function `len` [bad-argument-type]
+ ERROR tests/unittests/sources/test_upcloud.py:271:43-70: `None` is not subscriptable [unsupported-operation]
+ ERROR tests/unittests/sources/test_upcloud.py:271:43-74: Object of class `str` has no attribute `get` [missing-attribute]
+ ERROR tests/unittests/sources/test_upcloud.py:275:25-49: Argument `str | Unknown | None` is not assignable to parameter `obj` with type `Sized` in function `len` [bad-argument-type]
+ ERROR tests/unittests/sources/test_upcloud.py:276:28-55: `None` is not subscriptable [unsupported-operation]
+ ERROR tests/unittests/sources/test_upcloud.py:276:28-59: Object of class `str` has no attribute `get` [missing-attribute]
+ ERROR tests/unittests/sources/test_upcloud.py:280:25-43: Argument `str | Unknown | None` is not assignable to parameter `obj` with type `Sized` in function `len` [bad-argument-type]
+ ERROR tests/unittests/sources/test_upcloud.py:282:57-78: `None` is not subscriptable [unsupported-operation]
+ WARN tests/unittests/sources/test_vultr.py:268:24-38: Identity comparison `True is True` is always True [unnecessary-comparison]
+ ERROR tests/unittests/test_data.py:84:13-53: Argument `str | None` is not assignable to parameter `fname` with type `PathLike[Unknown] | str` in function `cloudinit.util.load_text_file` [bad-argument-type]
+ ERROR tests/unittests/test_data.py:219:13-53: Argument `str | None` is not assignable to parameter `fname` with type `PathLike[Unknown] | str` in function `cloudinit.util.load_text_file` [bad-argument-type]
+ ERROR tests/unittests/test_data.py:254:13-53: Argument `str | None` is not assignable to parameter `fname` with type `PathLike[Unknown] | str` in function `cloudinit.util.load_text_file` [bad-argument-type]
+ ERROR tests/unittests/test_data.py:449:13-53: Argument `str | None` is not assignable to parameter `fname` with type `PathLike[Unknown] | str` in function `cloudinit.util.load_text_file` [bad-argument-type]
+ ERROR tests/unittests/test_data.py:703:13-53: Argument `str | None` is not assignable to parameter `fname` with type `PathLike[Unknown] | str` in function `cloudinit.util.load_text_file` [bad-argument-type]
+ ERROR tests/unittests/test_data.py:730:33-73: Argument `str | None` is not assignable to parameter `fname` with type `PathLike[Unknown] | str` in function `cloudinit.util.load_text_file` [bad-argument-type]
+ ERROR tests/unittests/test_data.py:768:13-53: Argument `str | None` is not assignable to parameter `fname` with type `PathLike[Unknown] | str` in function `cloudinit.util.load_text_file` [bad-argument-type]
+ ERROR tests/unittests/test_upgrade.py:282:36-59: Object of class `NoneType` has no attribute `dsname` [missing-attribute]
+ ERROR tests/unittests/test_upgrade.py:283:19-43: Object of class `NoneType` has no attribute `sys_cfg` [missing-attribute]
+ ERROR tests/unittests/test_upgrade.py:284:18-41: Object of class `NoneType` has no attribute `distro` [missing-attribute]
+ ERROR tests/unittests/test_upgrade.py:285:17-39: Object of class `NoneType` has no attribute `paths` [missing-attribute]
+ ERROR tests/unittests/test_upgrade.py:300:16-39: Object of class `NoneType` has no attribute `distro` [missing-attribute]
+ ERROR tests/unittests/test_upgrade.py:303:16-38: Object of class `NoneType` has no attribute `paths` [missing-attribute]
+ ERROR tests/unittests/test_upgrade.py:306:16-44: Object of class `NoneType` has no attribute `vendordata2` [missing-attribute]
+ ERROR tests/unittests/test_upgrade.py:307:16-48: Object of class `NoneType` has no attribute `vendordata2_raw` [missing-attribute]
+ ::error file=tests/unittests/analyze/test_show.py,line=21,col=9,endLine=21,endColumn=23,title=Pyrefly missing-attribute::Object of class `tuple` has no attribute `infile`
... (truncated 109 lines) ...
openlibrary (https://github.com/internetarchive/openlibrary)
+ ERROR openlibrary/plugins/openlibrary/lists.py:811:43-813:18: Cannot set item in `dict[str, list[dict[Unknown, Unknown]]]` [unsupported-operation]
+ ERROR openlibrary/plugins/openlibrary/lists.py:818:40-88: Cannot set item in `dict[str, list[dict[Unknown, Unknown]]]` [unsupported-operation]
+ ERROR openlibrary/plugins/openlibrary/lists.py:823:42-825:18: Cannot set item in `dict[str, list[dict[Unknown, Unknown]]]` [unsupported-operation]
+ ERROR openlibrary/plugins/upstream/tests/test_merge_authors.py:152:12-52: Object of class `NoneType` has no attribute `key` [missing-attribute]
+ ::error file=openlibrary/plugins/openlibrary/lists.py,line=811,col=43,endLine=813,endColumn=18,title=Pyrefly unsupported-operation::Cannot set item in `dict[str, list[dict[Unknown, Unknown]]]`%0A Argument `list[Thing | Unknown]` is not assignable to parameter `value` with type `list[dict[Unknown, Unknown]]` in function `dict.__setitem__`
+ ::error file=openlibrary/plugins/openlibrary/lists.py,line=818,col=40,endLine=818,endColumn=88,title=Pyrefly unsupported-operation::Cannot set item in `dict[str, list[dict[Unknown, Unknown]]]`%0A Argument `list[Thing | Unknown]` is not assignable to parameter `value` with type `list[dict[Unknown, Unknown]]` in function `dict.__setitem__`
+ ::error file=openlibrary/plugins/openlibrary/lists.py,line=823,col=42,endLine=825,endColumn=18,title=Pyrefly unsupported-operation::Cannot set item in `dict[str, list[dict[Unknown, Unknown]]]`%0A Argument `list[Thing | Unknown]` is not assignable to parameter `value` with type `list[dict[Unknown, Unknown]]` in function `dict.__setitem__`
- ::error file=openlibrary/plugins/upstream/tests/test_merge_authors.py,line=37,col=9,endLine=37,endColumn=12,title=Pyrefly bad-override::Class member `MockSite.get` overrides parent class `Site` in an inconsistent manner%0A `MockSite.get` has type `BoundMethod[MockSite, (self: MockSite, key: Unknown) -> Unknown]`, which is not assignable to `BoundMethod[MockSite, (self: MockSite, key: Unknown, revision: Unknown | None = None, lazy: bool | Unknown = False) -> Unknown | None]`, the type of `Site.get`
+ ::error file=openlibrary/plugins/upstream/tests/test_merge_authors.py,line=37,col=9,endLine=37,endColumn=12,title=Pyrefly bad-override::Class member `MockSite.get` overrides parent class `Site` in an inconsistent manner%0A `MockSite.get` has type `BoundMethod[MockSite, (self: MockSite, key: Unknown) -> Thing | Unknown]`, which is not assignable to `BoundMethod[MockSite, (self: MockSite, key: Unknown, revision: Unknown | None = None, lazy: bool | Unknown = False) -> Thing | Unknown | None]`, the type of `Site.get`
+ ::error file=openlibrary/plugins/upstream/tests/test_merge_authors.py,line=152,col=12,endLine=152,endColumn=52,title=Pyrefly missing-attribute::Object of class `NoneType` has no attribute `key`
prefect (https://github.com/PrefectHQ/prefect)
+ ERROR src/integrations/prefect-dbt/tests/cli/test_commands.py:312:5-52: Object of class `NoneType` has no attribute `assert_called_with` [missing-attribute]
+ ERROR src/integrations/prefect-sqlalchemy/tests/test_database.py:213:17-54: Object of class `AsyncExitStack` has no attribute `close`
+ Object of class `NoneType` has no attribute `close` [missing-attribute]
+ ERROR src/integrations/prefect-sqlalchemy/tests/test_database.py:229:28-38: Cannot use `Connection` as a context manager [bad-context-manager]
+ ERROR src/integrations/prefect-sqlalchemy/tests/test_database.py:229:28-38: Cannot use `Connection` as a context manager [bad-context-manager]
+ ERROR src/integrations/prefect-sqlalchemy/tests/test_database.py:232:22-32: Cannot use `AsyncConnection` as a context manager [bad-context-manager]
+ ERROR src/integrations/prefect-sqlalchemy/tests/test_database.py:232:22-32: Cannot use `AsyncConnection` as a context manager [bad-context-manager]
+ ERROR src/integrations/prefect-sqlalchemy/tests/test_database.py:254:28-38: Cannot use `AsyncEngine` as a context manager [bad-context-manager]
+ ERROR src/integrations/prefect-sqlalchemy/tests/test_database.py:254:28-38: Cannot use `AsyncEngine` as a context manager [bad-context-manager]
+ ERROR src/integrations/prefect-sqlalchemy/tests/test_database.py:254:28-38: Cannot use `Connection` as a context manager [bad-context-manager]
+ ERROR src/integrations/prefect-sqlalchemy/tests/test_database.py:254:28-38: Cannot use `Connection` as a context manager [bad-context-manager]
+ ERROR src/integrations/prefect-sqlalchemy/tests/test_database.py:254:28-38: Cannot use `Engine` as a context manager [bad-context-manager]
+ ERROR src/integrations/prefect-sqlalchemy/tests/test_database.py:254:28-38: Cannot use `Engine` as a context manager [bad-context-manager]
+ ERROR src/integrations/prefect-sqlalchemy/tests/test_database.py:257:22-32: Cannot use `AsyncConnection` as a context manager [bad-context-manager]
+ ERROR src/integrations/prefect-sqlalchemy/tests/test_database.py:257:22-32: Cannot use `AsyncConnection` as a context manager [bad-context-manager]
+ ERROR src/integrations/prefect-sqlalchemy/tests/test_database.py:257:22-32: Cannot use `AsyncEngine` as a context manager [bad-context-manager]
+ ERROR src/integrations/prefect-sqlalchemy/tests/test_database.py:257:22-32: Cannot use `AsyncEngine` as a context manager [bad-context-manager]
+ ERROR src/integrations/prefect-sqlalchemy/tests/test_database.py:257:22-32: Cannot use `Engine` as a context manager [bad-context-manager]
+ ERROR src/integrations/prefect-sqlalchemy/tests/test_database.py:257:22-32: Cannot use `Engine` as a context manager [bad-context-manager]
+ ERROR src/integrations/prefect-sqlalchemy/tests/test_database.py:288:20-63: Argument `dict[str, CursorResult[Unknown]] | None` is not assignable to parameter `obj` with type `Sized` in function `len` [bad-argument-type]
+ ERROR src/integrations/prefect-sqlalchemy/tests/test_database.py:295:20-63: Argument `dict[str, CursorResult[Unknown]] | None` is not assignable to parameter `obj` with type `Sized` in function `len` [bad-argument-type]
+ ERROR src/integrations/prefect-sqlalchemy/tests/test_database.py:300:20-63: Argument `dict[str, CursorResult[Unknown]] | None` is not assignable to parameter `obj` with type `Sized` in function `len` [bad-argument-type]
+ ERROR src/integrations/prefect-sqlalchemy/tests/test_database.py:318:20-63: Argument `dict[str, CursorResult[Unknown]] | None` is not assignable to parameter `obj` with type `Sized` in function `len` [bad-argument-type]
+ ERROR src/integrations/prefect-sqlalchemy/tests/test_database.py:325:20-63: Argument `dict[str, CursorResult[Unknown]] | None` is not assignable to parameter `obj` with type `Sized` in function `len` [bad-argument-type]
+ ERROR src/integrations/prefect-sqlalchemy/tests/test_database.py:336:20-63: Argument `dict[str, CursorResult[Unknown]] | None` is not assignable to parameter `obj` with type `Sized` in function `len` [bad-argument-type]
+ ERROR src/integrations/prefect-sqlalchemy/tests/test_database.py:353:20-63: Argument `dict[str, CursorResult[Unknown]] | None` is not assignable to parameter `obj` with type `Sized` in function `len` [bad-argument-type]
+ ERROR src/integrations/prefect-sqlalchemy/tests/test_database.py:360:20-63: Argument `dict[str, CursorResult[Unknown]] | None` is not assignable to parameter `obj` with type `Sized` in function `len` [bad-argument-type]
+ ERROR src/integrations/prefect-sqlalchemy/tests/test_database.py:369:20-63: Argument `dict[str, CursorResult[Unknown]] | None` is not assignable to parameter `obj` with type `Sized` in function `len` [bad-argument-type]
+ ::error file=src/integrations/prefect-dbt/tests/cli/test_commands.py,line=312,col=5,endLine=312,endColumn=52,title=Pyrefly missing-attribute::Object of class `NoneType` has no attribute `assert_called_with`
+ ::error file=src/integrations/prefect-sqlalchemy/tests/test_database.py,line=213,col=17,endLine=213,endColumn=54,title=Pyrefly missing-attribute::Object of class `AsyncExitStack` has no attribute `close`%0AObject of class `NoneType` has no attribute `close`
+ ::error file=src/integrations/prefect-sqlalchemy/tests/test_database.py,line=229,col=28,endLine=229,endColumn=38,title=Pyrefly bad-context-manager::Cannot use `Connection` as a context manager%0A Object of class `Connection` has no attribute `__aenter__`%0A Did you mean `__enter__`?
+ ::error file=src/integrations/prefect-sqlalchemy/tests/test_database.py,line=229,col=28,endLine=229,endColumn=38,title=Pyrefly bad-context-manager::Cannot use `Connection` as a context manager%0A Object of class `Connection` has no attribute `__aexit__`%0A Did you mean `__exit__`?
+ ::error file=src/integrations/prefect-sqlalchemy/tests/test_database.py,line=232,col=22,endLine=232,endColumn=32,title=Pyrefly bad-context-manager::Cannot use `AsyncConnection` as a context manager%0A Object of class `AsyncConnection` has no attribute `__enter__`%0A Did you mean `__aenter__`?
+ ::error file=src/integrations/prefect-sqlalchemy/tests/test_database.py,line=232,col=22,endLine=232,endColumn=32,title=Pyrefly bad-context-manager::Cannot use `AsyncConnection` as a context manager%0A Object of class `AsyncConnection` has no attribute `__exit__`%0A Did you mean `__aexit__`?
+ ::error file=src/integrations/prefect-sqlalchemy/tests/test_database.py,line=254,col=28,endLine=254,endColumn=38,title=Pyrefly bad-context-manager::Cannot use `AsyncEngine` as a context manager%0A Object of class `AsyncEngine` has no attribute `__aenter__`
+ ::error file=src/integrations/prefect-sqlalchemy/tests/test_database.py,line=254,col=28,endLine=254,endColumn=38,title=Pyrefly bad-context-manager::Cannot use `AsyncEngine` as a context manager%0A Object of class `AsyncEngine` has no attribute `__aexit__`%0A Did you mean `__init__`?
+ ::error file=src/integrations/prefect-sqlalchemy/tests/test_database.py,line=254,col=28,endLine=254,endColumn=38,title=Pyrefly bad-context-manager::Cannot use `Connection` as a context manager%0A Object of class `Connection` has no attribute `__aenter__`%0A Did you mean `__enter__`?
+ ::error file=src/integrations/prefect-sqlalchemy/tests/test_database.py,line=254,col=28,endLine=254,endColumn=38,title=Pyrefly bad-context-manager::Cannot use `Connection` as a context manager%0A Object of class `Connection` has no attribute `__aexit__`%0A Did you mean `__exit__`?
+ ::error file=src/integrations/prefect-sqlalchemy/tests/test_database.py,line=254,col=28,endLine=254,endColumn=38,title=Pyrefly bad-context-manager::Cannot use `Engine` as a context manager%0A Object of class `Engine` has no attribute `__aenter__`
+ ::error file=src/integrations/prefect-sqlalchemy/tests/test_database.py,line=254,col=28,endLine=254,endColumn=38,title=Pyrefly bad-context-manager::Cannot use `Engine` as a context manager%0A Object of class `Engine` has no attribute `__aexit__`%0A Did you mean `__init__`?
+ ::error file=src/integrations/prefect-sqlalchemy/tests/test_database.py,line=257,col=22,endLine=257,endColumn=32,title=Pyrefly bad-context-manager::Cannot use `AsyncConnection` as a context manager%0A Object of class `AsyncConnection` has no attribute `__enter__`%0A Did you mean `__aenter__`?
+ ::error file=src/integrations/prefect-sqlalchemy/tests/test_database.py,line=257,col=22,endLine=257,endColumn=32,title=Pyrefly bad-context-manager::Cannot use `AsyncConnection` as a context manager%0A Object of class `AsyncConnection` has no attribute `__exit__`%0A Did you mean `__aexit__`?
+ ::error file=src/integrations/prefect-sqlalchemy/tests/test_database.py,line=257,col=22,endLine=257,endColumn=32,title=Pyrefly bad-context-manager::Cannot use `AsyncEngine` as a context manager%0A Object of class `AsyncEngine` has no attribute `__enter__`%0A Did you mean `__ne__`?
+ ::error file=src/integrations/prefect-sqlalchemy/tests/test_database.py,line=257,col=22,endLine=257,endColumn=32,title=Pyrefly bad-context-manager::Cannot use `AsyncEngine` as a context manager%0A Object of class `AsyncEngine` has no attribute `__exit__`%0A Did you mean `__init__`?
+ ::error file=src/integrations/prefect-sqlalchemy/tests/test_database.py,line=257,col=22,endLine=257,endColumn=32,title=Pyrefly bad-context-manager::Cannot use `Engine` as a context manager%0A Object of class `Engine` has no attribute `__enter__`
+ ::error file=src/integrations/prefect-sqlalchemy/tests/test_database.py,line=257,col=22,endLine=257,endColumn=32,title=Pyrefly bad-context-manager::Cannot use `Engine` as a context manager%0A Object of class `Engine` has no attribute `__exit__`%0A Did you mean `__init__`?
+ ::error file=src/integrations/prefect-sqlalchemy/tests/test_database.py,line=288,col=20,endLine=288,endColumn=63,title=Pyrefly bad-argument-type::Argument `dict[str, CursorResult[Unknown]] | None` is not assignable to parameter `obj` with type `Sized` in function `len`%0A Protocol `Sized` requires attribute `__len__`
+ ::error file=src/integrations/prefect-sqlalchemy/tests/test_database.py,line=295,col=20,endLine=295,endColumn=63,title=Pyrefly bad-argument-type::Argument `dict[str, CursorResult[Unknown]] | None` is not assignable to parameter `obj` with type `Sized` in function `len`%0A Protocol `Sized` requires attribute `__len__`
+ ::error file=src/integrations/prefect-sqlalchemy/tests/test_database.py,line=300,col=20,endLine=300,endColumn=63,title=Pyrefly bad-argument-type::Argument `dict[str, CursorResult[Unknown]] | None` is not assignable to parameter `obj` with type `Sized` in function `len`%0A Protocol `Sized` requires attribute `__len__`
+ ::error file=src/integrations/prefect-sqlalchemy/tests/test_database.py,line=318,col=20,endLine=318,endColumn=63,title=Pyrefly bad-argument-type::Argument `dict[str, CursorResult[Unknown]] | None` is not assignable to parameter `obj` with type `Sized` in function `len`%0A Protocol `Sized` requires attribute `__len__`
+ ::error file=src/integrations/prefect-sqlalchemy/tests/test_database.py,line=325,col=20,endLine=325,endColumn=63,title=Pyrefly bad-argument-type::Argument `dict[str, CursorResult[Unknown]] | None` is not assignable to parameter `obj` with type `Sized` in function `len`%0A Protocol `Sized` requires attribute `__len__`
+ ::error file=src/integrations/prefect-sqlalchemy/tests/test_database.py,line=336,col=20,endLine=336,endColumn=63,title=Pyrefly bad-argument-type::Argument `dict[str, CursorResult[Unknown]] | None` is not assignable to parameter `obj` with type `Sized` in function `len`%0A Protocol `Sized` requires attribute `__len__`
+ ::error file=src/integrations/prefect-sqlalchemy/tests/test_database.py,line=353,col=20,endLine=353,endColumn=63,title=Pyrefly bad-argument-type::Argument `dict[str, CursorResult[Unknown]] | None` is not assignable to parameter `obj` with type `Sized` in function `len`%0A Protocol `Sized` requires attribute `__len__`
+ ::error file=src/integrations/prefect-sqlalchemy/tests/test_database.py,line=360,col=20,endLine=360,endColumn=63,title=Pyrefly bad-argument-type::Argument `dict[str, CursorResult[Unknown]] | None` is not assignable to parameter `obj` with type `Sized` in function `len`%0A Protocol `Sized` requires attribute `__len__`
+ ::error file=src/integrations/prefect-sqlalchemy/tests/test_database.py,line=369,col=20,endLine=369,endColumn=63,title=Pyrefly bad-argument-type::Argument `dict[str, CursorResult[Unknown]] | None` is not assignable to parameter `obj` with type `Sized` in function `len`%0A Protocol `Sized` requires attribute `__len__`
ibis (https://github.com/ibis-project/ibis)
+ ERROR ibis/backends/bigquery/tests/system/conftest.py:109:12-21: Object of class `NoneType` has no attribute `table` [missing-attribute]
+ ERROR ibis/backends/bigquery/tests/system/conftest.py:119:12-21: Object of class `NoneType` has no attribute `table` [missing-attribute]
+ ERROR ibis/backends/bigquery/tests/system/conftest.py:124:12-21: Object of class `NoneType` has no attribute `table` [missing-attribute]
+ ERROR ibis/backends/bigquery/tests/system/conftest.py:129:12-21: Object of class `NoneType` has no attribute `table` [missing-attribute]
+ ERROR ibis/backends/clickhouse/tests/conftest.py:210:12-22: Object of class `NoneType` has no attribute `tables` [missing-attribute]
+ ERROR ibis/backends/conftest.py:418:24-32: Object of class `NoneType` has no attribute `name` [missing-attribute]
+ ERROR ibis/backends/conftest.py:426:24-32: Object of class `NoneType` has no attribute `name` [missing-attribute]
+ ERROR ibis/backends/conftest.py:434:24-32: Object of class `NoneType` has no attribute `name` [missing-attribute]
+ ERROR ibis/backends/conftest.py:509:12-26: Object of class `NoneType` has no attribute `execute` [missing-attribute]
... (truncated 479 lines) ...``` |
|
currently I fixed these cases in pytest.fixture return |
Summary
Fixes #1901
Implemented pytest import/alias detection plus fixture discovery and parameter scanning in pyrefly/lib/state/lsp.rs, and hooked it into go‑to‑definition and local references.
todo: should these pytest functions in their own mod?
Test Plan
cargo test pytest_fixture_parameter_goes_to_fixture_definition
cargo test pytest_fixture_references_include_injected_parameters