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.

classification
Title: Int tests enhancement and refactoring
Type: enhancement Stage: resolved
Components: Tests Versions: Python 3.2, Python 3.3, Python 3.4, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: 16761 16772 16790 16792 16793 Superseder:
Assigned To: serhiy.storchaka Nosy List: chris.jerdonek, ezio.melotti, iritkatriel, serhiy.storchaka
Priority: normal Keywords:

Created on 2012-12-26 10:33 by serhiy.storchaka, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (9)
msg178197 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2012-12-26 10:33
Int tests should be synchronized between different Python versions. Tests for int and long should be synchronized in 2.7. Common code for int and long tests should be shared in 2.7. CPython tests (i.e. small int identity) should be extracted to separated methods. Tests should be resorted by tested feature. Deprecated assertEquals should be replaced to assertEqual. And may be more.
msg178203 - (view) Author: Chris Jerdonek (chris.jerdonek) * (Python committer) Date: 2012-12-26 11:28
Other things that should be done include porting the more comprehensive tests in a recent changeset from 2.7 to 3.x and refactoring the try-except of one of the tests as necessary (see the Rietveld comments of issue 16761 for details on both).

The various issues in this comment and above should probably be broken into multiple patches.
msg178273 - (view) Author: Chris Jerdonek (chris.jerdonek) * (Python committer) Date: 2012-12-27 05:48
I created issue 16790 to allow the sharing of tests between test_int and test_long in 2.7.  I don't think issue 16761 and issue 16772 should be prerequisites to this issue though because both issues could benefit from issue 16790 being committed first (since both issues may involve adding tests to test_int and test_long).

Also, I don't necessarily think that *all* tests should be shared between test_int and test_long because that refactoring may be too invasive, but certainly the new ones we are considering adding.
msg178276 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2012-12-27 06:29
A large part of IntTestCases.test_basic() and LongTest.test_long() can be shared, as a number of smaller tests.
msg178277 - (view) Author: Chris Jerdonek (chris.jerdonek) * (Python committer) Date: 2012-12-27 06:32
Agreed.  I just didn't want it to be a requirement of beginning shared tests in case anyone objects to refactoring existing tests in 2.7 -- as opposed to using it for the addition of new tests.
msg178435 - (view) Author: Chris Jerdonek (chris.jerdonek) * (Python committer) Date: 2012-12-28 21:48
Another task: backport the tests for current behavior added under issue 16772 (e.g. test_int_base_limits() tests).
msg178441 - (view) Author: Chris Jerdonek (chris.jerdonek) * (Python committer) Date: 2012-12-28 23:49
Improvement of int/long tests should also be reflected in the Tests section of Misc/NEWS.  An entry wasn't added in issue 16045.  For linking purposes, this issue number would probably be the best to use for such an entry.
msg222103 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2014-07-02 13:27
is there anything left to do here?
msg380480 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2020-11-06 22:34
It seems that all dependencies are complete, so if nobody will object I will close this too.
History
Date User Action Args
2022-04-11 14:57:39adminsetgithub: 60988
2020-11-22 18:23:33iritkatrielsetstatus: pending -> closed
resolution: fixed
stage: needs patch -> resolved
2020-11-06 22:34:49iritkatrielsetstatus: open -> pending
nosy: + iritkatriel
messages: + msg380480

2019-03-16 00:10:42BreamoreBoysetnosy: - BreamoreBoy
2014-07-02 13:27:22BreamoreBoysetnosy: + BreamoreBoy
messages: + msg222103
2012-12-28 23:49:19chris.jerdoneksetmessages: + msg178441
2012-12-28 21:48:20chris.jerdoneksetmessages: + msg178435
2012-12-27 17:16:40serhiy.storchakasetdependencies: + Get rid of deprecated assertEquals etc in tests
2012-12-27 15:37:33serhiy.storchakasetdependencies: + Mark small ints test as CPython-only
2012-12-27 06:32:23chris.jerdoneksetmessages: + msg178277
2012-12-27 06:29:08serhiy.storchakasetmessages: + msg178276
2012-12-27 05:48:28chris.jerdoneksetdependencies: + provide ability to share tests between int and long tests
messages: + msg178273
2012-12-26 11:29:01ezio.melottisetnosy: + ezio.melotti
2012-12-26 11:28:19chris.jerdoneksetmessages: + msg178203
2012-12-26 10:40:01serhiy.storchakasetnosy: + chris.jerdonek
dependencies: + Fix int(base=X), int() accepts float number base
2012-12-26 10:33:21serhiy.storchakacreate