(create_module)
| 463 | |
| 464 | |
| 465 | def test_resolve_forward_ref_dataclass(create_module): |
| 466 | module = create_module( |
| 467 | # language=Python |
| 468 | """ |
| 469 | from __future__ import annotations |
| 470 | |
| 471 | from dataclasses import dataclass |
| 472 | |
| 473 | from pydantic import BaseModel |
| 474 | from typing import Literal |
| 475 | |
| 476 | @dataclass |
| 477 | class Base: |
| 478 | literal: Literal[1, 2] |
| 479 | |
| 480 | class What(BaseModel): |
| 481 | base: Base |
| 482 | """ |
| 483 | ) |
| 484 | |
| 485 | m = module.What(base=module.Base(literal=1)) |
| 486 | assert m.base.literal == 1 |
| 487 | |
| 488 | |
| 489 | def test_nested_forward_ref(): |
nothing calls this directly
no test coverage detected