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.

Title: Add regression test for geometric_mean
Type: behavior Stage: resolved
Components: Versions:
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: iritkatriel Nosy List: iritkatriel, mark.dickinson, steven.daprano
Priority: normal Keywords: patch

Created on 2021-08-20 10:23 by steven.daprano, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 27856 merged iritkatriel, 2021-08-20 10:51
Messages (2)
msg399956 - (view) Author: Steven D'Aprano (steven.daprano) * (Python committer) Date: 2021-08-20 10:23
Hi Irit, thanks for looking at #28327.

Sorry to be That Guy who can't do it himself, but I'm still stuck with old tech and ignorance about the git way of doing things, which limits my ability to do PRs :-(

Would you be willing to add a regression test for that bug to the file please?

If you can add a test case for this in

class TestGeometricMean

and make a PR that would be great. If you're not willing or able, please just reassign back to me and I'll go old school and make a patch file.

Should be fairly straight-forward, just add a method like

    def test_regression_28327(self):
        # Regression test for b.p.o. #28327
        gmean = statistics.geometric_mean
        expected = 3.80675409583932
        self.assertTrue(math.isclose(gmean([2, 3, 5, 7]), expected))
        self.assertTrue(math.isclose(gmean([2.0, 3.0, 5.0, 7.0]), expected))

msg399966 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2021-08-20 13:08
New changeset f5d7a8d29c49ad47254fa098abb7a510e5e7b45e by Irit Katriel in branch 'main':
bpo-44960: add regression test for geometric_mean with mixed int/floa… (#27856)
Date User Action Args
2022-04-11 14:59:49adminsetgithub: 89123
2021-08-20 13:09:28iritkatrielsetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2021-08-20 13:08:29iritkatrielsetmessages: + msg399966
2021-08-20 11:30:20iritkatrielsettitle: Add regression test for geometric test -> Add regression test for geometric_mean
2021-08-20 10:51:24iritkatrielsetkeywords: + patch
stage: patch review
pull_requests: + pull_request26315
2021-08-20 10:33:21mark.dickinsonsetnosy: + mark.dickinson
2021-08-20 10:23:50steven.dapranocreate