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

no longer consider properties for fixtures of plugin objects (manages warning triggers) #6898

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

RonnyPfannschmidt
Copy link
Member

this one carries a bug-fix for for the fixture lookup that we might want to add in general
as well as a stacklevel ix for the terminalwriter deprecation

if necessary i can extract

i'd like to add a unittest for the fixture parsing but i haven't approached the details yet

  • Include new tests or update existing tests when applicable.
  • Create a new changelog file in the changelog folder,

@RonnyPfannschmidt RonnyPfannschmidt changed the title [wip] Fix regendoc [DEFERED] Fix regendoc Mar 11, 2020
@RonnyPfannschmidt
Copy link
Member Author

deferring this pr as the "bugfix" is postentially a breaking change, the regendoc will have to have the warning

@@ -1413,6 +1413,11 @@ def parsefactories(self, node_or_obj, nodeid=NOTSET, unittest=False):
for name in dir(holderobj):
# The attribute can be an arbitrary descriptor, so the attribute
# access below can raise. safe_getatt() ignores such exceptions.
# additionally properties are ignored by default to avoid triggering warnings
Copy link
Member

Choose a reason for hiding this comment

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

For reference, the safe_getattr() and comment above was added in 3a0a0c2 to fix #2234. There I wrote

A better solution would be to completely skip access to all custom descriptors, such that the offending code doesn't even trigger. However I think this requires manually going through the instance and all of its MRO for each and every attribute checking if it might be a proper fixture before accessing it. So I took the easy route here.

So this at least seems to be a step in the right direction. But this was a long time ago.

There's a question if this is any backward compatibility concern here. Is it possible in any way to use a property as a fixture? (I'm not familiar with this code yet).

In any case I think it would be to discuss this change in a separate PR so it can be considered properly.

Copy link
Member Author

Choose a reason for hiding this comment

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

as a breaking change its ok to drop consideration for properties

as methods are descriptors, we cant drop everything

i would prefer if we could set up better separation for fixture lokup

@nicoddemus
Copy link
Member

@RonnyPfannschmidt should we close this in the spirit of clearing up the queue, to be tackled again in the future?

@RonnyPfannschmidt
Copy link
Member Author

I plan to sort it out before 6.0

@RonnyPfannschmidt
Copy link
Member Author

@nicoddemus i tried to add a test, but its looking like i can't trigger a warning message easily, there may be a missing part of warning coverage

Base automatically changed from master to main March 9, 2021 20:40
@nicoddemus
Copy link
Member

@RonnyPfannschmidt this might be stale after the recent regendoc fixes?

@RonnyPfannschmidt RonnyPfannschmidt changed the title [wip] Fix regendoc no longer consider properties for fixtures of plugin objects (manages warning triggers) Nov 16, 2021
@RonnyPfannschmidt RonnyPfannschmidt marked this pull request as draft November 16, 2021 12:55
@RonnyPfannschmidt
Copy link
Member Author

@The-Compiler could this be something for 7.x?

@The-Compiler
Copy link
Member

I'd honestly rather not ressurrect a 2 year old PR (hopefully) so close to the release - seems like a lot of potential to delay things further.

@nicoddemus
Copy link
Member

@RonnyPfannschmidt was this superseded by #12781?

@RonnyPfannschmidt
Copy link
Member Author

Mostly, I intend is to verify and close this week

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.

4 participants