[rfc] bzrlib.doc.api doctests as txt files

Alexander Belchenko bialix at ukr.net
Tue May 9 11:21:34 BST 2006


This subpackage (bzrlib.doc.api) wrote Robert Collins so probably this 
question mostly addressed to him.

I make bzr.exe for win32 with py2exe. All python packages py2exe store 
into one library.zip file and during executing of program this modules 
imported via zipimport. All stuff works. Only txt files inside 
bzrlib/doc/api break normal behaviour (break selftest command).

Now I simply disable this tests when directory 
os.getcwd()/bzrlib/doc/api does not exists. Therefore this tests will 
never be executed on win32 in bzr.exe form. Is this important part of 
test suite? I see in comments that it mostly used as examples of using 
api. So I think it can be omitted in case when we provide bzr.exe with 
bzrlib bundled inside.

If there is important to run this tests even in bzr.exe form then this 
files probably should be converted to usual python source for normal 
importing and bundling into library.zip.

I try to store this text files apart of library.zip (in directory 
data/bzrlib/doc/api) but doctest.py from standard python library anyway 
try to open files with filename pointed into library.zip:

@@@ bzr.exe peek doc-api tests from 
E:\work\Python\bzr\0.8\bzr.0.8.win32.installer\win32_bzr.exe/data/bzrlib/doc/api

bzr: ERROR: exceptions.IOError: [Errno 2] No such file or directory: 
'E:\\work\\Python\\bzr\\0.8\\bzr.0.8.win32.installer\\win32
_bzr.exe\\lib\\library.zip\\bzrlib\\doc\\api\\branch.txt'
   at doctest.pyc line 2343
   in DocFileTest


What do you think about? Just skip this test in bzr.exe is enough?

--
Alexander





More information about the bazaar mailing list