File: test_isinstance.py

package info (click to toggle)
pydantic 2.12.5-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,628 kB
  • sloc: python: 75,989; javascript: 181; makefile: 115; sh: 38
file content (15 lines) | stat: -rw-r--r-- 266 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from pydantic import BaseModel


class ModelV2(BaseModel):
    my_str: str


mv2 = ModelV2(my_str='hello')


def test_isinstance_basemodel(benchmark) -> None:
    @benchmark
    def run():
        for _ in range(10000):
            assert isinstance(mv2, BaseModel)