Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix comparison of dataclasses with InitVar #9842

Merged
merged 1 commit into from Apr 9, 2022
Merged

fix comparison of dataclasses with InitVar #9842

merged 1 commit into from Apr 9, 2022

Conversation

asottile
Copy link
Member

@asottile asottile commented Apr 8, 2022

resolves #9820

Copy link
Member

@nicoddemus nicoddemus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thanks!

fields_to_check = [field for field, info in all_fields.items() if info.compare]
import dataclasses

all_fields = dataclasses.fields(left)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@nicoddemus nicoddemus added the needs backport applied to PRs, indicates that it should be ported to the current bug-fix branch label Apr 8, 2022
@asottile asottile merged commit f0cf63a into pytest-dev:main Apr 9, 2022
@asottile asottile deleted the init-var-only-dataclasses branch April 9, 2022 00:08
@asottile asottile added backport 7.1.x and removed needs backport applied to PRs, indicates that it should be ported to the current bug-fix branch labels Apr 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Assertion diffs print-outs break on dataclasses with InitVar fields
2 participants