[7.1.x] fix comparison of dataclasses with InitVar

This commit is contained in:
Anthony Sottile
2022-04-08 20:08:51 -04:00
committed by pytest bot
parent 7a501fb313
commit 5ef96fdb53
4 changed files with 24 additions and 2 deletions

View File

@@ -0,0 +1,12 @@
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)