[issue20780] Shadowed (duplicate name but different body) test in test_statistics

Vajrasky Kok report at bugs.python.org
Wed Feb 26 11:43:17 CET 2014


New submission from Vajrasky Kok:

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.

----------
components: Tests
files: fix_shadowed_test_in_test_statistics.patch
keywords: patch
messages: 212247
nosy: stevenjd, vajrasky
priority: normal
severity: normal
status: open
title: Shadowed (duplicate name but different body) test in test_statistics
type: behavior
versions: Python 3.4
Added file: http://bugs.python.org/file34228/fix_shadowed_test_in_test_statistics.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue20780>
_______________________________________


More information about the Python-bugs-list mailing list