Author vajrasky
Recipients steven.daprano, vajrasky
Date 2014-02-26.10:43:16
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1393411397.34.0.693108095146.issue20780@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2014-02-26 10:43:17vajraskysetrecipients: + vajrasky, steven.daprano
2014-02-26 10:43:17vajraskysetmessageid: <1393411397.34.0.693108095146.issue20780@psf.upfronthosting.co.za>
2014-02-26 10:43:17vajraskylinkissue20780 messages
2014-02-26 10:43:17vajraskycreate