[Python-ideas] Make test.test_support an alias to test.support

Terry Reedy tjreedy at udel.edu
Sat Aug 10 20:50:45 CEST 2013


On 8/10/2013 7:07 AM, Nick Coghlan wrote:
> On 9 August 2013 07:34, Terry Reedy <tjreedy at udel.edu> wrote:

>> However, we could say that one should only run the 2.7.z test suite with the
>> 2.7.z interpreter and stdlib.
>
> This is certainly the case - you can't run the test suite for a later
> version against an earlier version and expect it to work.

Thinking a bit more, of course. New tests for fixed bugs will not pass 
on earlier releases. That is the point of making bugfix releases. Less 
obvious is that tests can rely on a bug (no necessarily in the module 
directly being tested) and break when a future release fixes the bug.

>> If we do that, I would like to change the
>> illegal name 'lib-tk' to '_libtk' and change the tk/ttk tests accordingly.

Looking further, I see that 2.x sys.path has .../lib/lib-tk added 
*after* .../lib, so I withdraw that idea. The 'problem' is that tk tests 
need to import lib/lib-tk/test (and its contents) but cannot do so 
directly because 'import test' would import lib/test instead of 
lib/lib-tk/test. Currently they engage in contortions to get around the 
name clash. To me, the better solution would be to eliminate the name 
clash by renaming lib-tk/test to lib-tk/tk_test or lib-tk/_tktest (to 
mark it as private).

>> If 'can change or be removed without notice between releases of Python.'
>> refers to bug-fix releases as well as version releases, I might propose a
>> few more changes, or rather, to  also backport proposed changes for 3.4 to
>> 2.7.

I am referring to http://bugs.python.org/issue18604
"Consolidate gui available checks in test.support"
Any patch will necessarily change the tk test files in both test/ and 
lib-tk/test/ since part of the issue is to move gui check code from 
lib-tk/test/support to test/support. I will raise the backport question 
once there is an agreed-upon patch.

> Don't go too overboard with it, but the test suite is definitely more
> open to updates than the standard library itself. (e.g. the conversion
> of test.support to a package was applied to the 3.3 maintenance branch
> to keep it in sync with the default branch).

 > And PEP 434 certainly applies to IDLE's test suite in addition to 
IDLE itself.

I think the reasoning of the PEP applies in part to the tkinter test 
suite, including the lib-tk part. That will be part of any backport 
discussion on the issue.

-- 
Terry Jan Reedy



More information about the Python-ideas mailing list