Skip to content

Respect PYTEST_DONT_REWRITE for plugins too. - #3025

Merged
RonnyPfannschmidt merged 3 commits into
pytest-dev:masterfrom
anntzer:dont-rewrite-plugin
Dec 13, 2017
Merged

RonnyPfannschmidt merged 3 commits into
pytest-dev:masterfrom
anntzer:dont-rewrite-plugin

Conversation

@anntzer

@anntzer anntzer commented Dec 13, 2017

Copy link
Copy Markdown
Contributor

See #2995.


Thanks for submitting a PR, your contribution is really appreciated!

Here's a quick checklist that should be present in PRs:

  • Add a new news fragment into the changelog folder
    • name it $issue_id.$type for example (588.bugfix)
    • if you don't have an issue_id change it to the pr id after creating the pr
    • ensure type is one of removal, feature, bugfix, vendor, doc or trivial
    • Make sure to use full sentences with correct case and punctuation, for example: "Fix issue with non-ascii contents in doctest text files."
  • Target: for bugfix, vendor, doc or trivial fixes, target master; for removals or features target features;
  • Make sure to include reasonable tests for your change if necessary

Unless your change is a trivial or a documentation fix (e.g., a typo or reword of a small section) please:

  • Add yourself to AUTHORS, in alphabetical order;
    [already there]

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage decreased (-0.0008%) to 92.748% when pulling c8e7d1a on anntzer:dont-rewrite-plugin into 5c6d773 on pytest-dev:master.

Comment thread _pytest/assertion/rewrite.py Outdated
if name not in self._rewritten_names:
self._warn_already_imported(name)
already_imported = (
(set(names) & set(sys.modules)) - set(self._rewritten_names))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

the python guide on sets proposes to write this as something more like

set(names).intersection(sys.modules).difference(self._rewritten_names) it would be nice to use that for the cleanup

@nicoddemus nicoddemus left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, thanks a lot @anntzer!

@nicoddemus

Copy link
Copy Markdown
Member

(Note to maintainers: we have to remember to manually close the issue manually)

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage decreased (-0.0008%) to 92.748% when pulling 45e7734 on anntzer:dont-rewrite-plugin into 5c6d773 on pytest-dev:master.

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.006%) to 92.755% when pulling 45e7734 on anntzer:dont-rewrite-plugin into 5c6d773 on pytest-dev:master.

@RonnyPfannschmidt
RonnyPfannschmidt merged commit 506c9c9 into pytest-dev:master Dec 13, 2017
@anntzer
anntzer deleted the dont-rewrite-plugin branch December 13, 2017 16:45
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