-
-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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 assertFloatsAreIdentical/assertComplexAreIdentical to unittest (or kwarg to assertEqual)? #121039
Labels
Comments
Eclips4
added
stdlib
Python modules in the Lib dir
type-feature
A feature request or enhancement
and removed
type-feature
A feature request or enhancement
stdlib
Python modules in the Lib dir
labels
Jun 26, 2024
skirpichev
added a commit
to skirpichev/cpython
that referenced
this issue
Jun 27, 2024
pr is ready: #121071 (it implements the last option: methods added to test.support) |
serhiy-storchaka
pushed a commit
that referenced
this issue
Sep 8, 2024
skirpichev
added a commit
to skirpichev/cpython
that referenced
this issue
Sep 8, 2024
….support.testcase (pythonGH-121071) (cherry picked from commit 8ef8354) Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
picnixz
added
tests
Tests in the Lib/test dir
and removed
stdlib
Python modules in the Lib dir
labels
Sep 9, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Feature or enhancement
Proposal:
Clones of assertFloatsAreIdentical() are scattered across the CPython tests:
cpython/Lib/test/test_complex.py
Line 74 in d8f8243
cpython/Lib/test/test_cmath.py
Line 68 in d8f8243
cpython/Lib/test/test_float.py
Line 1069 in d8f8243
cpython/Lib/test/test_capi/test_getargs.py
Line 440 in d8f8243
Maybe it's worth to have a dedicated check?
Or a special kwarg for the assertEqual method, to workaround
NAN
and-0.0
values for floats/complexes.Edit:
Or at least some support from Lib/test/support... I was adding similar helper yet in another test file and that looks odd.
Numpy has numpy.testing.assert_equal():
Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Links to previous discussion of this feature:
No response
Linked PRs
The text was updated successfully, but these errors were encountered: