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

Add pytest 3 compatibility in brain_pytest #357

Merged
merged 4 commits into from
Aug 22, 2016
Merged

Add pytest 3 compatibility in brain_pytest #357

merged 4 commits into from
Aug 22, 2016

Conversation

The-Compiler
Copy link
Contributor

This adds compatibility with pytest 3.0 to brain_pytest.py, where some attributes were added and others moved.

It also adds some failing attributes which are already present in older pytest versions, like pytest.xfail which existed for a long time.

In the second commit, I also re-added pytest 2.9 support (and it also seems to work fine with 2.7 still, didn't test older versions) as 3.0 is quite a big update and I don't expect everyone to upgrade immediately.


try:
import _pytest.freeze_support
freeze_includes = _pytest.freeze_support.freeze_includes
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I decided to do the assignments here instead of in an else: as there's no way this second line could raise an ImportError, and this makes the nested ImportErrors much more readable IMHO.

@The-Compiler
Copy link
Contributor Author

Do I need to add myself to the copyrights, or will you run copyrite before the next release?

@coveralls
Copy link

Coverage Status

Coverage decreased (-2.06%) to 86.961% when pulling cd757ca on The-Compiler:pytest3 into 3ea47e5 on PyCQA:master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 89.016% when pulling 40913ed on The-Compiler:pytest3 into 3ea47e5 on PyCQA:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage remained the same at 89.016% when pulling 40913ed on The-Compiler:pytest3 into 3ea47e5 on PyCQA:master.

@PCManticore
Copy link
Contributor

I can run it before the next release, you don't have to worried about that. Do you need a patch release or something? Since the default will go into 1.5.0, it could potentially take a while to be released, together with pylint 2.0, which is why I am asking.

@The-Compiler
Copy link
Contributor Author

I think that would be great to have - I already have some suppressions for a no-member with pytest.xfail.

I'm not sure what happens after upgrading to pytest 3.0 - the old code snippet would probably raise an AttributeError, but I don't get any no-member messages anyways?

@PCManticore PCManticore merged commit 8ec025f into pylint-dev:master Aug 22, 2016
PCManticore pushed a commit that referenced this pull request Aug 22, 2016
This change adjusts brain_pytest for pytest 3, while also reintroducing pytest 2 compatibility.
The-Compiler added a commit to qutebrowser/qutebrowser that referenced this pull request Aug 23, 2016
brycepg pushed a commit to brycepg/astroid that referenced this pull request Feb 27, 2018
This change adjusts brain_pytest for pytest 3, while also reintroducing pytest 2 compatibility.
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.

3 participants