python-minimal test suite
Matthias Klose
m at klose.in-berlin.de
Mon Jan 10 01:47:57 CST 2005
The idea for an extra test run with only the modules available from
python-minimal came up during the last developer meeting.
- the current check for missing modules in python-minimal is already
done, and the build breaks if the list of modules isn't complete.
- 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.
Another outcome: copy and operator are used very often in the testsuite,
so maybe add them to -minimal as well.
Opinions?
Matthias
More information about the ubuntu-devel
mailing list