Skip to content
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

Shadowed (duplicate name but different body) test in test_statistics #64979

Closed
vajrasky mannequin opened this issue Feb 26, 2014 · 3 comments
Closed

Shadowed (duplicate name but different body) test in test_statistics #64979

vajrasky mannequin opened this issue Feb 26, 2014 · 3 comments
Labels
tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error

Comments

@vajrasky
Copy link
Mannequin

vajrasky mannequin commented Feb 26, 2014

BPO 20780
Nosy @benjaminp, @ezio-melotti, @stevendaprano, @vajrasky
Files
  • fix_shadowed_test_in_test_statistics.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2015-02-25.21:46:40.542>
    created_at = <Date 2014-02-26.10:43:17.308>
    labels = ['type-bug', 'tests']
    title = 'Shadowed (duplicate name but different body) test in test_statistics'
    updated_at = <Date 2015-02-25.21:46:40.540>
    user = 'https://github.com/vajrasky'

    bugs.python.org fields:

    activity = <Date 2015-02-25.21:46:40.540>
    actor = 'benjamin.peterson'
    assignee = 'none'
    closed = True
    closed_date = <Date 2015-02-25.21:46:40.542>
    closer = 'benjamin.peterson'
    components = ['Tests']
    creation = <Date 2014-02-26.10:43:17.308>
    creator = 'vajrasky'
    dependencies = []
    files = ['34229']
    hgrepos = []
    issue_num = 20780
    keywords = ['patch']
    message_count = 3.0
    messages = ['212247', '236622', '236624']
    nosy_count = 5.0
    nosy_names = ['benjamin.peterson', 'ezio.melotti', 'steven.daprano', 'BreamoreBoy', 'vajrasky']
    pr_nums = []
    priority = 'normal'
    resolution = 'out of date'
    stage = 'patch review'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue20780'
    versions = ['Python 3.4']

    @vajrasky
    Copy link
    Mannequin Author

    vajrasky mannequin commented Feb 26, 2014

    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.

    @vajrasky vajrasky mannequin added tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error labels Feb 26, 2014
    @BreamoreBoy
    Copy link
    Mannequin

    BreamoreBoy mannequin commented Feb 25, 2015

    @steven would you like to formally review the patch please. At a very quick glance it looks okay to me.

    @benjaminp
    Copy link
    Contributor

    The duplicate tests have been renamed already.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant