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: merge large parts of and
Type: enhancement Stage:
Components: Tests Versions: Python 3.5
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: mark.dickinson, martin.panter, rhettinger, vstinner, wolma
Priority: normal Keywords:

Created on 2014-09-25 12:27 by wolma, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (3)
msg227530 - (view) Author: Wolfgang Maier (wolma) * Date: 2014-09-25 12:27 says that it tests binary operators on subtypes of built-in types, but in fact largely focuses on testing its own class Rat, which simply inherits from object and is, essentially, just a simple implementation of fractions.Fraction.

Instead of doing mostly redundant tests here and there it might be better to merge this part (up to line 305) of into, then maybe add tests of subtypes of built-in types other than just object to

This requires quite a bit of work though for a relatively minor improvement so do you think it's worth the effort ?
msg233871 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2015-01-12 01:48
Yeah it would be good to put related tests in the one place.

I was trying to find a good place to test how the comparison operators invoke the __eq__(), __gt__() etc methods, and the existing tests seem to be spread over and
msg280763 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2016-11-14 12:18
> This requires quite a bit of work though for a relatively minor improvement so do you think it's worth the effort ?

If you factorize code of unit tests, I expect better tests and more tests, so yes, it's valuable.

But since this issue is old (no activity last 2 years), I close the issue.

Please come back with a reviewable patch (reopen the issue, or open a new one, it's up to you), so it will be easier to discuss. The patch doesn't have to be complete, you can start by factorizing a single function just to discuss the principle and then complete the patch.

Note: I added our fractions experts to the issue while closing it :-)
Date User Action Args
2022-04-11 14:58:08adminsetgithub: 66685
2016-11-14 12:18:19vstinnersetstatus: open -> closed

nosy: + rhettinger, vstinner, mark.dickinson
messages: + msg280763

resolution: out of date
2015-01-12 01:48:54martin.pantersetmessages: + msg233871
2015-01-12 01:43:53martin.pantersetnosy: + martin.panter
2014-09-25 12:27:44wolmacreate