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): fix few tests, use pytest.raises, extend raises helper #500

Merged
merged 3 commits into from
Dec 13, 2023

Conversation

antoni-szych-rtbhouse
Copy link
Contributor

@antoni-szych-rtbhouse antoni-szych-rtbhouse commented Dec 13, 2023

Hi, I thought it would be nice to modernize tests a bit:

  • use with pytest.raises() or with raises() in multiple places
  • parametrize a few tests
  • make raises() manager throw AssertionError if expected exception was not raised inside the context
  • fix 1 or 2 asserts in tests that were incorrectly working due to the above
  • remove python 2 or <3.2 compatibility code (note: this extends beyond tests)

I have some doubts regarding existing tests if they really test what they say they do, especially test_self_any and test_self_all. However it should be checked by someone with more experience (I haven't used Self-related validation yet myself)

Copy link
Owner

@alecthomas alecthomas left a comment

Choose a reason for hiding this comment

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

Good idea!

@alecthomas alecthomas merged commit dec0fcb into alecthomas:master Dec 13, 2023
5 checks passed
@antoni-szych-rtbhouse antoni-szych-rtbhouse deleted the pytest-raises branch December 14, 2023 08:26
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