[MERGE][0.14] Skip tests when 'tools' is not available

Wouter van Heyst larstiq at larstiq.dyndns.org
Thu Jan 18 16:34:14 GMT 2007

On Thu, Jan 18, 2007 at 06:16:26PM +0200, Alexander Belchenko wrote:
> John Arbash Meinel пишет:
> > We do not install the 'tools' package that exists in the source
> > distribution. Recently Alexander added a couple of tests for it (which
> > is good), but they fail in an installed copy because the package is not
> > available (bad thing).
> I apologize for this. And because it's my fault I'd like to help
> to fix it.
> > 
> > This patch just skips them if it cannot find the 'tools' packages.
> > 
> > Arguably, it should know more about whether it is in source or not,
> > (potentially these tests could start skipping and we wouldn't realize
> > they weren't running).
> > 
> > I'm still happy enough with it to ask for it to be merged.
> Can we assume that selftest is launched from inside bzr.dev
> sources, so directore where bzr script is located should be presence
> of bzrlib and tools packages? If we can permit this assumption
> we can create test class in test_generate_docs.py conditionally.

No, this was exposed because selftest gets run outside of the source

> Or we can allow to run this test *only* from bzr.dev repository,
> i.e. by check presence of valid bzr.dev branch?

Can we decrease the dependency on things outside bzrlib in a different
way? The other way around we also have a problem btw,
bzrlib/transport/sftp.py imports StubServer from bzrlib.tests.stub_sftp.

> I.e. when running on installed copy we just check if in directory with
> bzr presents both bzrlib and tools packages, this check fails and we
> fall to create test class itself. I'd like to check not only presence
> of tools package because this name is too general.

I prefer John's solution to skip the tests if tools.doc_generate can't
be imported.

Wouter van Heyst
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 307 bytes
Desc: Digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20070118/a676a9e6/attachment-0001.pgp 

More information about the bazaar mailing list