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

Convert backend tests to use pytest #7863

Merged
merged 5 commits into from
Jan 23, 2017

Conversation

QuLogic
Copy link
Member

@QuLogic QuLogic commented Jan 18, 2017

Net line count drop, seems good to me.

Also, fix one of the decorators to work properly with pytest.

@tacaswell tacaswell added this to the 2.1 (next point release) milestone Jan 18, 2017
finally:
shutil.rmtree(test_dir)

if __name__ == "__main__":
Copy link
Member

Choose a reason for hiding this comment

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

How do we run tests on only one module with pytest?

@NelleV
Copy link
Member

NelleV commented Jan 19, 2017

I don't know pytest well. How do you run tests on only one module with pytest?

@QuLogic
Copy link
Member Author

QuLogic commented Jan 19, 2017

If it's installed from source, you can use the file itself: pytest lib/matplotlib/tests/test_backend_bases.py or if you want to test the installed version pytest --pyargs matplotlib.tests.test_backend_bases.

Copy link
Member

@NelleV NelleV left a comment

Choose a reason for hiding this comment

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

LGTM.

For the record, I am quite concerned by how complex this transition to pytests is.

@NelleV NelleV changed the title Convert backend tests to use pytest [MRG+1] Convert backend tests to use pytest Jan 20, 2017
@QuLogic
Copy link
Member Author

QuLogic commented Jan 20, 2017

To give these individual PRs some substance, I have not done just a straight conversion, but also tried to take advantage of pytest's additional niceties. I can do a PR of just straight nose-removal if there's interest in that.

@NelleV
Copy link
Member

NelleV commented Jan 20, 2017

I think this underlines that our test suite is very complex, which unfortunately means also complicated to maintain. I also don't find pytest very nice nor readable to use, but it might just be a question of getting used to it.

@phobson
Copy link
Member

phobson commented Jan 20, 2017

@NelleV it is a very different approach, for sure. I tried for ~18 months to like pytest, and just couldn't get into it.

Then about a year ago I forced myself to start from scratch with it on a new package and it clicked and made python magical again.

@QuLogic
Copy link
Member Author

QuLogic commented Jan 22, 2017

I added one more change to fix the determinism tests from the backends which are not fully included in the test_backend_* files.

@phobson
Copy link
Member

phobson commented Jan 23, 2017

What in tarnation is taking the CI so long on this? I'll kick to the see if that helps.

@phobson phobson closed this Jan 23, 2017
@phobson phobson reopened this Jan 23, 2017
@QuLogic
Copy link
Member Author

QuLogic commented Jan 23, 2017

You might have missed it, but I rebased because of the conflicts.

@phobson
Copy link
Member

phobson commented Jan 23, 2017

This looks good to me.

@phobson
Copy link
Member

phobson commented Jan 23, 2017

Oh, sorry @QuLogic . The Github UI said the commits were from 6 days ago. I can't blame them for that. But it was confusing nonetheless.

@jkseppan jkseppan changed the title [MRG+1] Convert backend tests to use pytest Convert backend tests to use pytest Jan 23, 2017
@jkseppan jkseppan merged commit 0b1d896 into matplotlib:master Jan 23, 2017
@QuLogic QuLogic deleted the pytest-backends branch January 23, 2017 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

5 participants