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 b3e6873 commit 5176b39
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
Original file line number Diff line number Diff line change
@@ -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 5176b39

Please sign in to comment.