[MERGE] Allow plugins to select test runner class
Marius Gedminas
marius at pov.lt
Sat Feb 14 21:10:50 GMT 2009
On Thu, Feb 12, 2009 at 04:04:26PM +1100, Robert Collins wrote:
> def set_subunit_runner(option, name, new_value, parser):
> # We're active: import dependencies and setup environment
> from bzrlib.tests import TextTestRunner
> from bzrlib import osutils
> from subunit import TestProtocolClient
> class SubUnitBzrRunner(TextTestRunner):
> def run(self, test):
> # undo bzrlib's claim for testing which looks like a test.
> self.stream.write("success: %s\n" % (osutils.realpath(sys.argv[0]),))
> result = TestProtocolClient(self.stream)
> test.run(result)
> return result
> cmd.additional_selftest_args['runner_class'] = SubUnitBzrRunner
> # Don't pass 'subunit' as an option down to cmd_selftest's run
> # method.
> del parser.values.__dict__['subunit']
Any reason to deal with __dict__ directly instead of
del parser.values.subunit
?
Marius Gedminas
--
(Why, oh! why is X not written in Lisp?)
-- Juliusz Chroboczek
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20090214/0b4e83df/attachment.pgp
More information about the bazaar
mailing list