classification
Title: provide ability to share tests between int and long tests
Type: enhancement Stage: resolved
Components: Tests Versions: Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: chris.jerdonek, python-dev, serhiy.storchaka
Priority: normal Keywords: easy, patch

Created on 2012-12-27 05:33 by chris.jerdonek, last changed 2012-12-27 20:56 by chris.jerdonek. This issue is now closed.

Files
File name Uploaded Description Edit
issue-16790-1-27.patch chris.jerdonek, 2012-12-27 05:43
issue-16790-2-27.patch chris.jerdonek, 2012-12-27 06:54
Messages (9)
msg178271 - (view) Author: Chris Jerdonek (chris.jerdonek) * (Python committer) Date: 2012-12-27 05:33
Currently, adding new int() and long() tests that are common to both requires duplicating the tests in both test_int and test_long, which makes the tests harder to review and maintain and keep in synch.

Providing a simple way to share tests between test_int and test_long will simplify adding new tests for issues like issue 16784, issue 16761, and issue 16772.

This issue isn't applicable to 3.x because in 3.x test_int and test_long both test int(), so it doesn't make sense to repeat tests in both.
msg178272 - (view) Author: Chris Jerdonek (chris.jerdonek) * (Python committer) Date: 2012-12-27 05:43
Attaching patch.  The tests moved to SharedTestCaseMixin in this patch are tests that were very recently added (as part of issue 16045) and that are planned on being added to test_long as part of issue 16784.
msg178274 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2012-12-27 06:11
Why not inherit IntTestCases and LongTest from SharedTestCaseMixin? And looks as CommonSomeTest naming is more common than SharedSomeTest.
msg178278 - (view) Author: Chris Jerdonek (chris.jerdonek) * (Python committer) Date: 2012-12-27 06:33
Good point.  New patch coming shortly.
msg178281 - (view) Author: Chris Jerdonek (chris.jerdonek) * (Python committer) Date: 2012-12-27 06:54
Note that we need to be more careful about checking for duplicate test names now.
msg178282 - (view) Author: Chris Jerdonek (chris.jerdonek) * (Python committer) Date: 2012-12-27 07:08
After this issue, the ordering of new test_int test cases in 3.x should preferably match the ordering in 2.7 for easier back-porting when the tests are new in both.  For example, test_no_args() and test_keyword_args() could go at the top of 3.x's IntTestCases.
msg178305 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2012-12-27 17:23
LGTM.
msg178329 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2012-12-27 20:54
New changeset eb1734e579f7 by Chris Jerdonek in branch '2.7':
Issue #16790: add some of the recent issue #16045 int tests to test_long.
http://hg.python.org/cpython/rev/eb1734e579f7
msg178330 - (view) Author: Chris Jerdonek (chris.jerdonek) * (Python committer) Date: 2012-12-27 20:56
Thanks for the reviews, Serhiy.
History
Date User Action Args
2012-12-27 20:56:35chris.jerdoneksetstatus: open -> closed
resolution: fixed
messages: + msg178330

stage: patch review -> resolved
2012-12-27 20:54:39python-devsetnosy: + python-dev
messages: + msg178329
2012-12-27 17:23:14serhiy.storchakasetmessages: + msg178305
2012-12-27 07:08:13chris.jerdoneksetmessages: + msg178282
2012-12-27 06:54:13chris.jerdoneksetfiles: + issue-16790-2-27.patch

messages: + msg178281
2012-12-27 06:33:59chris.jerdoneksetmessages: + msg178278
2012-12-27 06:11:34serhiy.storchakasetnosy: + serhiy.storchaka
messages: + msg178274

components: + Tests, - Interpreter Core
type: enhancement
stage: patch review
2012-12-27 05:48:28chris.jerdoneklinkissue16784 dependencies
2012-12-27 05:43:13chris.jerdoneksetfiles: + issue-16790-1-27.patch
keywords: + patch
messages: + msg178272
2012-12-27 05:33:17chris.jerdonekcreate