Strange test failure in test_selftest on vanilla

John Arbash Meinel john at
Mon Mar 12 15:27:46 GMT 2007

Hash: SHA1

Aaron Bentley wrote:
> Hi all,
> I've got a test case failure in a vanilla copy of  This
> shouldn't be happening.  Probably indicates a platform difference
> between my (Edgy) laptop and PQM.
> $ ./bzr selftest test_selftest
>        bzr: /home/abentley/bzr/
>     bzrlib: /home/abentley/bzr/
> [56/75 in 2s] blackbox.test_selftest.TestOptions.test_transport
> ----------------------------------------------------------------------
> Ran 1 test in 0.002s

Something weird is going on here. Your above statement says that "Ran 1
test in 0.002s" is printed when you run "bzr selftest".

v- This is just looking for the "Ran 1 test" line. But if you  look at
the output, it isn't there.

> ======================================================================
> FAIL: test_transport (bzrlib.tests.blackbox.test_selftest.TestOptions)
> vvvv[log from
> bzrlib.tests.blackbox.test_selftest.TestOptions.test_transport]-
> run bzr: ['selftest', '--transport=sftp', 'test_transport_set_to_sftp']
> bzr arguments: ['selftest', '--transport=sftp',
> 'test_transport_set_to_sftp']
> encoding stdout as sys.stdout encoding 'UTF-8'
>     INFO  tests passed
> output:
> '       bzr: /home/abentley/bzr/\n    bzrlib:
> /home/abentley/bzr/\n\n'
> errors:
> 'tests passed\n'
> ^^^^[log from
> bzrlib.tests.blackbox.test_selftest.TestOptions.test_transport]-
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File
> "/home/abentley/bzr/",
> line 77, in test_transport
>     self.assertContainsRe(stdout, 'Ran 1 test')
>   File "/home/abentley/bzr/", line 751,
> in assertContainsRe
>     raise AssertionError('pattern "%r" not found in "%r"'
> AssertionError: pattern "'Ran 1 test'" not found in "'       bzr:
> /home/abentley/bzr/\n    bzrlib:
> /home/abentley/bzr/\n\n'"
> ----------------------------------------------------------------------
> Ran 75 tests in 7.680s
> FAILED (failures=1)
> tests failed

My best guess is that stdout isn't getting flushed properly. Which is
really weird considering that stdout should be a StringIO object.

Notice that you have the setup portion:

       bzr: /home/abentley/bzr/
    bzrlib: /home/abentley/bzr/

And you even have the 'test passed' line. But you don't have the "Ran 1
test in X.XXXs".

And when I run 'bzr selftest' it always reports that line. Even if it is
'Ran 0 tests'.

So while it could be a pqm thing, it seems to be something weird.

It isn't running a different bzr, because self.capture doesn't spawn a
subprocess. So this seems like a genuine failure somewhere, which should
be investigated.

Version: GnuPG v1.4.5 (Cygwin)
Comment: Using GnuPG with Mozilla -


More information about the bazaar mailing list