Skip to content

Commit

Permalink
Fix test for 1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Viicos committed Dec 2, 2023
1 parent 4431d7b commit c8a4b21
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions tests/mypy/outputs/1.0.1/mypy-plugin_ini/root_models.py
@@ -0,0 +1,27 @@
from typing import List

from pydantic import RootModel


class Pets1(RootModel[List[str]]):
pass


Pets2 = RootModel[List[str]]


class Pets3(RootModel):
# MYPY: error: Missing type parameters for generic type "RootModel" [type-arg]
root: List[str]


pets1 = Pets1(['dog', 'cat'])
# MYPY: error: Too many positional arguments for "Pets1" [misc]
pets2 = Pets2(['dog', 'cat'])
pets3 = Pets3(['dog', 'cat'])
# MYPY: error: Too many positional arguments for "Pets3" [misc]


class Pets4(RootModel[List[str]]):
pets: List[str]
# MYPY: error: Only `root` is allowed as a field of a `RootModel` [pydantic-field]

0 comments on commit c8a4b21

Please sign in to comment.