classification
Title: Shadowed (duplicate name but different body) test in test_statistics
Type: behavior Stage: patch review
Components: Tests Versions: Python 3.4
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: BreamoreBoy, benjamin.peterson, ezio.melotti, steven.daprano, vajrasky
Priority: normal Keywords: patch

Created on 2014-02-26 10:43 by vajrasky, last changed 2015-02-25 21:46 by benjamin.peterson. This issue is now closed.

Files
File name Uploaded Description Edit
fix_shadowed_test_in_test_statistics.patch vajrasky, 2014-02-26 10:46 review
Messages (3)
msg212247 - (view) Author: Vajrasky Kok (vajrasky) * Date: 2014-02-26 10:43
Line 994 of Lib/test/test_statistics.py:

    def test_decimal_mismatched_infs_to_nan(self):
        # Test adding Decimal INFs with opposite sign returns NAN.
        inf = Decimal('inf')
        data = [1, 2, inf, 3, -inf, 4]
        with decimal.localcontext(decimal.ExtendedContext):
            self.assertTrue(math.isnan(statistics._sum(data)))

    def test_decimal_mismatched_infs_to_nan(self):
        # Test adding Decimal INFs with opposite sign raises InvalidOperation.
        inf = Decimal('inf')
        data = [1, 2, inf, 3, -inf, 4]
        with decimal.localcontext(decimal.BasicContext):
            self.assertRaises(decimal.InvalidOperation, statistics._sum, data)

Here is the patch. I also removed unnecessary import.
msg236622 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2015-02-25 21:44
@Steven would you like to formally review the patch please.  At a very quick glance it looks okay to me.
msg236624 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2015-02-25 21:46
The duplicate tests have been renamed already.
History
Date User Action Args
2015-02-25 21:46:40benjamin.petersonsetstatus: open -> closed

nosy: + benjamin.peterson
messages: + msg236624

resolution: out of date
2015-02-25 21:44:14BreamoreBoysetnosy: + BreamoreBoy
messages: + msg236622
2014-05-09 12:22:12ezio.melottisetnosy: + ezio.melotti

stage: patch review
2014-02-26 10:46:15vajraskysetfiles: - fix_shadowed_test_in_test_statistics.patch
2014-02-26 10:46:09vajraskysetfiles: + fix_shadowed_test_in_test_statistics.patch
2014-02-26 10:43:17vajraskycreate