◐ Shell
clean mode source ↗

gh-102837: Increase test coverage for the math module by skirpichev · Pull Request #110000 · python/cpython

* fsum: L1367, L1377, L1381, L1410

// line numbers wrt to 54fbfa8
… nonnegative and PyLong_AsDouble raises only OverflowError.

serhiy-storchaka

serhiy-storchaka

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, I think that one of changes in your previous PR should be reverted.

@skirpichev

Also, I think that one of changes in your previous PR should be reverted.

Thanks for a suggestion. I did more efficient rewrite of that part, as discussed in the thread.

serhiy-storchaka

@serhiy-storchaka

How did you write new tests? They look wildly random to me.

@skirpichev

How did you write new tests? They look wildly random to me.

I prefer exact results, if possible. Then I try to use arch-independent values (e.g. "big enough" integers to trigger overflows on all platforms. And they should hit mentioned lines. Otherwise, they are random.

This was referenced

Oct 26, 2023

@encukou

This PR combines

  • test improvements, which should be backported
  • refactoring (dead code removal), which IMO should not be backported, and
  • possibly a bugfix, which should be backported together with a previously failing test

To make the backporting easier, would it make sense to split the PR along those lines?

@skirpichev

@encukou, sorry, I wasn't aware that tests are systematically backported (based on #102067 and #102523).

possibly a bugfix, which should be backported together with a previously failing test

Probably, you are about typo in sumprod(). This is fixed and backported, see #111342. Or something else?

@encukou

The backporting is a fairly new policy.

But, another benefit of splitting this would be that the test additions could be merged right now, without waiting for @mdickinson to comment on the removed code :)

Thanks for the typo fix!

@skirpichev

skirpichev

@mdickinson

Please could some kind person remove the request for review for me?

@skirpichev

@serhiy-storchaka, I'm going to close this (together with the issue) on same ground as #109642. It seems, CPython devs not welcoming now code coverage improvements.