Merge lp:~mbp/bzr/trivial into lp:bzr

Proposed by Martin Pool
Status: Merged
Merged at revision: not available
Proposed branch: lp:~mbp/bzr/trivial
Merge into: lp:bzr
Diff against target: 15 lines (+5/-0)
1 file modified
bzrlib/tests/__init__.py (+5/-0)
To merge this branch: bzr merge lp:~mbp/bzr/trivial
Reviewer Review Type Date Requested Status
Robert Collins (community) Approve
Review via email: mp+16525@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Martin Pool (mbp) wrote :

Better error if testtools is too old.

Revision history for this message
Robert Collins (lifeless) wrote :

__version__ is new in testtools, so you probably need

if getattr(testtools, '__version__', ()) < (0, 9, 2):

review: Approve
Revision history for this message
Robert Collins (lifeless) wrote :

Oh, and it should be above the content import; that can error too.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'bzrlib/tests/__init__.py'
--- bzrlib/tests/__init__.py 2009-12-23 05:04:12 +0000
+++ bzrlib/tests/__init__.py 2009-12-23 06:38:11 +0000
@@ -51,6 +51,11 @@
51import warnings51import warnings
5252
53import testtools53import testtools
54# nb: check this before importing anything else from within it
55_testtools_version = getattr(testtools, '__version__', ())
56if _testtools_version < (0, 9, 2):
57 raise ImportError("need at least testtools 0.9.2: %s is %r"
58 % (testtools.__file__, _testtools_version))
54from testtools import content59from testtools import content
5560
56from bzrlib import (61from bzrlib import (