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

[prerelease] Removed instance attribute on Module / Class #9486

Closed
The-Compiler opened this issue Jan 7, 2022 · 1 comment · Fixed by #9494
Closed

[prerelease] Removed instance attribute on Module / Class #9486

The-Compiler opened this issue Jan 7, 2022 · 1 comment · Fixed by #9494
Assignees
Labels
topic: collection related to the collection phase type: backward compatibility might present some backward compatibility issues which should be carefully noted in the changelog
Milestone

Comments

@The-Compiler
Copy link
Member

Yet another subtle API break I discovered in 7.0.0 (sorry...):

Before #9277, Module and Class nodes had a instance attribute from PyobjMixin (via PyCollector). With that change, that attribute now is only available on Function nodes.

This affected pytest-randomly - I don't see a good way to find out how much more it affects (can't really search for .instance, and there are lots of ways to get to those nodes).

I doubt it will affect much more, but we should either re-add the attribute (probably just set to None plus a deprecation warning?), or if we decide to remove it without a deprecation (fine by me), at least document the removal as usual.

cc @bluetech

@The-Compiler The-Compiler added topic: collection related to the collection phase type: backward compatibility might present some backward compatibility issues which should be carefully noted in the changelog labels Jan 7, 2022
@The-Compiler The-Compiler added this to the 7.0 milestone Jan 7, 2022
@bluetech
Copy link
Member

bluetech commented Jan 9, 2022

Yes, it should be restored (and return None) - assigning to myself.

@bluetech bluetech self-assigned this Jan 9, 2022
bluetech added a commit to bluetech/pytest that referenced this issue Jan 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: collection related to the collection phase type: backward compatibility might present some backward compatibility issues which should be carefully noted in the changelog
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants