-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Two tests fails with pydantic
installed
#9270
Comments
Same problem in astroid, see https://github.com/pylint-dev/astroid/actions/runs/7159067546/job/19491909890?pr=2340. Since this has the potential to start blocking us, raising the priority. |
Hi @david-yz-liu ! Would you have a minute to recommend a course of action with the failing test in astroid that exhibits a similar issue?
def test_pydantic_field() -> None:
"""Test that pydantic.Field attributes are currently Uninferable.
(Eventually, we can extend the brain to support pydantic.Field)
"""
klass, instance = astroid.extract_node(
"""
from pydantic import Field
from pydantic.dataclasses import dataclass
@dataclass
class A:
name: str = Field("hi")
A.name #@
A().name #@
"""
)
inferred = klass.inferred()
assert len(inferred) == 1
> assert inferred[0] is Uninferable
E assert <Instance of pydantic.fields.FieldInfo at 0x4532641808> is Uninferable
tests/brain/test_dataclasses.py:461: AssertionError |
Hi @jacobtylerwalls! Sorry I'm in the middle of exam season so I don't have a lot of time, but off the top of my head it looks like:
I'm making some assumptions in the above, so I could be wrong! But that's where I would start. This sounds urgent so I can take a closer look in a few days, if that's helpful. |
Thanks, that's very helpful. Sounds like it's okay to just update the test and ensure that pydantic is either installed or the test is skipped. In terms of urgency, I think this was just a problem because |
Yeah I think that's good. By the way, I think the tests are parameterized to include |
Refs #9270 (cherry picked from commit 47410ad) Co-authored-by: Jacob Walls <[email protected]>
Bug description
Configuration
No response
Command used
Pylint output
Expected behavior
All tests pass even with
pydantic
installed.Pylint version
OS / Environment
OpenIndiana
Additional dependencies
No response
The text was updated successfully, but these errors were encountered: