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

Minimal conversion to pytest+hypothesis #52

Merged
merged 3 commits into from
Oct 21, 2022
Merged

Conversation

mgorny
Copy link
Contributor

@mgorny mgorny commented Oct 17, 2022

The purpose of this PR is to get the test suite working on pytest, without depending on nose in any way and while making minimal changes to the existing code.

What I had to do is:

  • move tests from __init__.py to test_*.py
  • replace nose_random with hypothesis

…and that's pretty much it. It's fine to use unittest-style classes with pytest. Hypothesis seems to integrate neatly in place of nose_random.

pytest defaults to running tests from files named `test_*`, so move
the tests into one.  Leave an empty `__init__.py` to keep relative
imports working.
Use hypothesis as the closest pytest equivalent of nose_random.  With
some extra features like failure outputs with easy reproducers.
@mgorny mgorny mentioned this pull request Oct 17, 2022
@fzumstein
Copy link
Member

have you seen #51 ? How does it compare?

@mgorny
Copy link
Contributor Author

mgorny commented Oct 17, 2022

Fixes #44.

@fzumstein
Copy link
Member

have you seen #51 ? How does it compare?

Gotcha, just saw your comment in #51

@mgorny
Copy link
Contributor Author

mgorny commented Oct 17, 2022

have you seen #51 ? How does it compare?

It roughly tries to minimize the amount of changes and make the code look as close to the original as possible. Also hypothesis is pretty neat when things start failing.

@fzumstein
Copy link
Member

thanks!

@fzumstein fzumstein merged commit aa30b51 into xlwings:master Oct 21, 2022
@mgorny mgorny deleted the pytest branch October 22, 2022 04:57
@mgorny
Copy link
Contributor Author

mgorny commented Oct 22, 2022

Thanks a lot!

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.

2 participants