python-minimal test suite

Matt Zimmerman mdz at ubuntu.com
Tue Jan 11 14:51:27 CST 2005


On Mon, Jan 10, 2005 at 08:47:57AM +0100, Matthias Klose wrote:

> - the separate test suite run for the python-minimal modules works, but
> the test cases and testsuite need more modules than are contained in
> python minimal. The approach taken is to modify each test case to import
> the needed modules:
> 
> 	import sys
> 	sys.path.append(<path with all modules>)
> 	import <module not in -minimal>
> 	sys.path.append(<path with all modules>)
> 	del sys
> 
> after a test run, the imported modules have to be removed from
> sys.modules. Unfortunately unloading the modules doesn't work for every
> module, so you end up with test cases in the test suite, where an import
> succeeds, because the module is already imported, but not in sys.path
> (anymore).
> 
> The approach to patch all tests works, but seems to be a maintainance
> burden. There are however some results: time.strptime is currently
> unusable in -minimal. The C extension imports the _strptime module,
> depending on gettext, locale and _locale, copy, calendar. Having locale
> imported and referring to encodings, we will end up including these in
> -minimal as well. What to do?
>    1) Include all the referenced modules (150k).
>    2) Write a time.strptime, based on the C implementation, handling the
> same as the
>       Python implementation does.
>    3) Document it and leave it unimplemented.
> First solution can be taken by adding the modules, but increases the
> size of -minimal, second solution maybe adds some incompatibilities,
> when the complete module set is not available. Third thing could be a
> solution, if it's documented somewhere.
> 
> For the test of -minimal it should be sufficient to specify a list of
> tests from the complete testsuite, which have to pass or else the build
> of the package will fail.

I agree, I don't think it makes sense to patch the tests.

150k is for the dependencies of time.strptime, yes?

How large are the dependencies of the test suite itself?

> Another outcome: copy and operator are used very often in the testsuite,
> so maybe add them to -minimal as well.

How big are they?

-- 
 - mdz



More information about the ubuntu-devel mailing list