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 check for zero denominator in approx #10624

Merged
merged 5 commits into from Jan 24, 2023

Conversation

jayendra-patil33
Copy link
Contributor

closes #10533

Copy link
Member

@nicoddemus nicoddemus left a comment

Choose a reason for hiding this comment

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

Thanks @jayendra-patil33!

Could you please:

  1. Add a test to avoid future regressions?

  2. Add a changelog entry, as a new file changelog/10533.bugfix.rst describing the fix, like:

    Fix :func:`pytest.approx` handling of dictionaries containing one or more values of `0.0`.
    

@jayendra-patil33
Copy link
Contributor Author

Done

@nicoddemus
Copy link
Member

Hi @jayendra-patil33,

I don't see the requested changes, did you forget to push perhaps?

@jayendra-patil33
Copy link
Contributor Author

Sorry, it seems that was indeed the case, now I have pushed the code.

Copy link
Member

@nicoddemus nicoddemus left a comment

Choose a reason for hiding this comment

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

Awesome, thanks!

@nicoddemus nicoddemus merged commit ca40380 into pytest-dev:main Jan 24, 2023
@nicoddemus nicoddemus changed the title added a check if denominator is zero Add check for zero denominator in approx Jan 24, 2023
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.

assert a == approx(b) when b is dict containing zero value results in ZeroDivisionError
2 participants