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

_pytest.compat.get_real_func is unaware of getattr-ish objects like #2208

RonnyPfannschmidt opened this Issue Jan 19, 2017 · 1 comment


None yet
2 participants

RonnyPfannschmidt commented Jan 19, 2017

this would break on things like the object, there should be an iteration limit

i propose using something like

for _ in range(1000):
  new_func = getattr(func, '__wrapped__', None)
  if new_func is None:
    func = new_func
  raise ValueError("unwrap failed to find a end")

all tho i presume we can pick a much lower iteration count

RonnyPfannschmidt added a commit to RonnyPfannschmidt/pytest that referenced this issue Jan 19, 2017

nicoddemus added a commit that referenced this issue Jan 19, 2017

Merge pull request #2209 from RonnyPfannschmidt/bugfix-2208/get_real_…

fixes #2208 by introducing a iteration limit

This comment has been minimized.


nicoddemus commented Jan 19, 2017

Fixed by #2209

@nicoddemus nicoddemus closed this Jan 19, 2017

This was referenced Mar 6, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment