This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Some tests in test_cmath use rAssertAlmostEqual incorrectly
Type: behavior Stage:
Components: Tests Versions: Python 2.7
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: mark.dickinson Nosy List: flox, mark.dickinson
Priority: normal Keywords: patch

Created on 2009-12-20 19:37 by flox, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
issue7554_cmath.diff flox, 2009-12-20 19:41 Patch, apply to trunk
Messages (6)
msg96718 - (view) Author: Florent Xicluna (flox) * (Python committer) Date: 2009-12-20 19:37
These tests do not pass the right arguments to rAssertAlmostEqual.
They should use assertAlmostEqual instead.

(around line 123)

        self.rAssertAlmostEqual(cmath.pi, pi_expected, 9,
            "cmath.pi is %s; should be %s" % (cmath.pi, pi_expected))
        self.rAssertAlmostEqual(cmath.e,  e_expected, 9,
            "cmath.e is %s; should be %s" % (cmath.e, e_expected))
msg96719 - (view) Author: Florent Xicluna (flox) * (Python committer) Date: 2009-12-20 19:41
I've done a review of this test file, and removed code duplication
between function "almostEqualF" and method "rAssertAlmostEqual".

(and changed some syntax to make "-3" happy)
msg96720 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2009-12-20 19:59
Thanks!  Fixed in r76941 (trunk) and r76942 (release26-maint)  (with 
tweaks in the following two revisions).
msg96721 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2009-12-20 20:00
Whoops;  I didn't see your patch until too late.
msg96722 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2009-12-20 20:27
test_math changes applied in r76945 (trunk), and backported to release26-
maint in r76946 for good measure.  For the sake of ease of maintenance, I 
used code that matched the existing py3k code, rather than the exact code 
Florent provided.
msg96723 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2009-12-20 20:41
Applied the test_cmath part of the patch in r76948 (trunk) and r76950 
(py3k).  I was too lazy to backport to the maintenance releases, mostly 
because that would have involved replacing all the '{}'s in format strings 
with numbered versions. ('{0}' ...)

Thanks again, Florent!
History
Date User Action Args
2022-04-11 14:56:55adminsetgithub: 51803
2009-12-20 20:41:03mark.dickinsonsetstatus: open -> closed
resolution: accepted
messages: + msg96723
2009-12-20 20:27:22mark.dickinsonsetmessages: + msg96722
2009-12-20 20:00:24mark.dickinsonsetstatus: closed -> open
assignee: mark.dickinson
resolution: fixed -> (no value)
messages: + msg96721
2009-12-20 19:59:32mark.dickinsonsetstatus: open -> closed

nosy: + mark.dickinson
messages: + msg96720

resolution: fixed
2009-12-20 19:41:35floxsetfiles: + issue7554_cmath.diff
keywords: + patch
messages: + msg96719
2009-12-20 19:38:12floxsettitle: Some tests in test_cmath should use rAssertAlmostEqual incorrectly -> Some tests in test_cmath use rAssertAlmostEqual incorrectly
2009-12-20 19:37:58floxcreate