Skip to content

Simplify mpl.testing._copy_metadata. #9300

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

Merged
merged 1 commit into from
Oct 22, 2017

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Oct 6, 2017

mpl.testing._copy_metadata was basically doing the job
of functools.update_wrapper. We don't need to specify
compat_co_firstlineono either as pytest will look up the
lineno in the wrapped function (_pytest.compat.get_real_func,
_pytest.compat.getfslineno). It's also for this reason that we need
to make sure __wrapped__ is properly set, even on Py2.

PR Summary

PR Checklist

  • Has Pytest style unit tests
  • Code is PEP 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

`mpl.testing._copy_metadata` was basically doing the job
of `functools.update_wrapper`.  We don't need to specify
`compat_co_firstlineono` either as pytest will look up the
lineno in the wrapped function (`_pytest.compat.get_real_func`,
`_pytest.compat.getfslineno`).  It's also for this reason that we need
to make sure `__wrapped__` is properly set, even on Py2.
@tacaswell tacaswell added this to the 2.2 (next feature release) milestone Oct 6, 2017
@tacaswell
Copy link
Member

@anntzer Go buy a lottery ticket, your PR passed appveyor!

@tacaswell tacaswell merged commit 2f8370d into matplotlib:master Oct 22, 2017
@anntzer anntzer deleted the simplify-copy-metadata branch October 22, 2017 00:52
@QuLogic QuLogic modified the milestones: needs sorting, v2.2.0 Feb 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants