possible backward incompatibility in test.regrtest

Hi developers, It seems that the test.regrtest module has a possible backward incompatibility with regard to pre-Python 2.3 releases. I have a test suit implemented using the test.regrtest module. In this test suit, my own tests are invoked by a script like this: import os from test import regrtest regrtest.STDTESTS = [] regrtest.main(testdir=os.getcwd()) This script runs fine with 2.2 but does not with 2.3, since regrtest.py in Python 2.3 has the following lines in runtest() (introduced in Revision 1.87.2.1. See [1]): if test.startswith('test.'): abstest = test else: # Always import it from the test package abstest = 'test.' + test the_package = __import__(abstest, globals(), locals(), []) That is, tests must be in a package named "test". However, this package name is already used by the standard library, and AFAIK multiple packages with the same package name cannot exist. In other words, any additional tests (i.e. my own tests) have to be put into the test package in the standard library. Otherwise, the additional tests won't be found. IMHO, this change in 2.3 is not reasonable. Unless I miss something trivial (I hope so), I'd have to give up using the test.regrtest module. I appreciate any comment. Thanks, -- KAJIYAMA, Tamito <kajiyama@grad.sccs.chukyo-u.ac.jp> [1] http://cvs.sourceforge.net/viewcvs.py/python/python/dist/src/Lib/test/regrtest.py?r1=1.87&r2=1.87.2.1

Tamito> It seems that the test.regrtest module has a possible backward Tamito> incompatibility with regard to pre-Python 2.3 releases. I have Tamito> a test suit implemented using the test.regrtest module. ... Tamito> Unless I miss something trivial (I hope so), I'd have to give up Tamito> using the test.regrtest module. I think this is the best course. The advertised (and supported) way to build test suites in Python is with the unittest module. Skip

Tamito> It seems that the test.regrtest module has a possible backward Tamito> incompatibility with regard to pre-Python 2.3 releases. I have Tamito> a test suit implemented using the test.regrtest module. ... Tamito> Unless I miss something trivial (I hope so), I'd have to give up Tamito> using the test.regrtest module. I think this is the best course. The advertised (and supported) way to build test suites in Python is with the unittest module. Skip
participants (2)
-
Skip Montanaro
-
Tamito KAJIYAMA