File: test_compare_initvar.py

package info (click to toggle)
pytest 9.0.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 8,308 kB
  • sloc: python: 65,808; makefile: 45
file content (15 lines) | stat: -rw-r--r-- 260 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# mypy: allow-untyped-defs
from __future__ import annotations

from dataclasses import dataclass
from dataclasses import InitVar


@dataclass
class Foo:
    init_only: InitVar[int]
    real_attr: int


def test_demonstrate():
    assert Foo(1, 2) == Foo(1, 3)