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
1=== modified file 'bzrlib/tests/__init__.py'
2--- bzrlib/tests/__init__.py 2009-12-23 05:04:12 +0000
3+++ bzrlib/tests/__init__.py 2009-12-23 06:38:11 +0000
4@@ -51,6 +51,11 @@
5 import warnings
6
7 import testtools
8+# nb: check this before importing anything else from within it
9+_testtools_version = getattr(testtools, '__version__', ())
10+if _testtools_version < (0, 9, 2):
11+ raise ImportError("need at least testtools 0.9.2: %s is %r"
12+ % (testtools.__file__, _testtools_version))
13 from testtools import content
14
15 from bzrlib import (