test_ok2/testing/example_scripts/dataclasses/test_compare_initvar.py

13 lines
197 B
Python

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)