-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
pytest.approx doesn't support comparison between arrays and scalars #3312
Labels
status: help wanted
developers would like help from experts on this topic
type: enhancement
new feature or API change, should be merged into features branch
type: proposal
proposal for a new feature, often to gather opinions or design the API around the new feature
Comments
pytestbot
added
status: help wanted
developers would like help from experts on this topic
type: refactoring
internal improvements to the code
labels
Mar 14, 2018
GitMate.io thinks possibly related issues are #1994 (Supporting arrays for approx), #1123 (does pytest support to this way to collect test cases?), #2043 (Pytest does not support indirect parameters for overriden fixtures), #2796 (Possible bug in pytest --doctest comparison), and #2196 (Pytest on cygwin doesn't find files). |
nicoddemus
added
type: enhancement
new feature or API change, should be merged into features branch
type: proposal
proposal for a new feature, often to gather opinions or design the API around the new feature
and removed
type: bug
problem that needs to be addressed
type: refactoring
internal improvements to the code
labels
Mar 14, 2018
Thanks @tadeu! |
closing since the pull request was merged |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
status: help wanted
developers would like help from experts on this topic
type: enhancement
new feature or API change, should be merged into features branch
type: proposal
proposal for a new feature, often to gather opinions or design the API around the new feature
Sometimes we want to assert that all elements from an array are approximately equal to a single value, so this code comes naturally to mind:
the problem is that
pytest.approx
doesn't support this (the workaround is to create a second array with the same shape and filled with the scalar).Here is a test case:
here are the outputs:
This is
pip list
, including pytest version:The text was updated successfully, but these errors were encountered: