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

Refactor tests to use pytest fixtures #136

Closed
Zsailer opened this issue Nov 4, 2019 · 3 comments
Closed

Refactor tests to use pytest fixtures #136

Zsailer opened this issue Nov 4, 2019 · 3 comments
Assignees
Milestone

Comments

@Zsailer
Copy link
Member

Zsailer commented Nov 4, 2019

At the last jupyter_server meeting, I mentioned that Jupyter Server's testing framework needs some attention. It's fairly brittle and hasn't been reviewed since we forked from jupyter/notebook.

I argued that we should refactor the tests into pytest's fixture based style. I believe this is more readable and accessible to contributors.

I think it's critical that we get our tests in place ASAP, so that development can move forward confidently. I'm going to spend some time this week refactoring tests.

@Zsailer Zsailer changed the title Refactor tests to use pytest Refactor tests to use pytest fixtures Nov 4, 2019
@Zsailer
Copy link
Member Author

Zsailer commented Nov 10, 2019

Sharing an update here.

I have a separate repo with pytests for Jupyter Server. Feel free to tour that repo while I continue working.

These tests rely on pytest-tornado and pytest-asyncio. Getting these two libraries to work together took me more time than I'd like to admit... but I think the result is fantastic.

  • Tests are explicit.
  • They use the async/await syntax.
  • The fixtures are straightforward.

The outcome is that tests should be easier to contribute to. I'll add a bit more documentation before moving the test modules over here.

I've also been using Github actions for deploying tests. I love it. I think we should consider moving our tests to Github actions from travis + appveyor. Thoughts?

@maartenbreddels
Copy link
Contributor

Getting these two libraries to work together took me more time than I'd like to admit...

I am not surprised, it's a tricky business, but very important work to get readable tests!

but I think the result is fantastic.

🎉

I think we should consider moving our tests to Github actions from travis + appveyor. Thoughts?

What I've seen, it's pretty fast, so I'm all for it!

Thanks for spearheading this.

@Zsailer Zsailer self-assigned this Dec 2, 2019
@Zsailer Zsailer added this to the 0.2.0 Release milestone Dec 2, 2019
@Zsailer
Copy link
Member Author

Zsailer commented Dec 14, 2019

This is finally finished in #152 and #156!

@Zsailer Zsailer closed this as completed Dec 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants