~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_plugins.py

  • Committer: Martin
  • Date: 2010-04-02 19:12:58 UTC
  • mto: (5177.1.1 integration2)
  • mto: This revision was merged to the branch mainline in revision 5179.
  • Revision ID: gzlist@googlemail.com-20100402191258-xrwedy2ffe0q4t7x
Permit bzrlib to run under python -OO by explictly assigning to __doc__ for user-visible docstrings

Show diffs side-by-side

added added

removed removed

Lines of Context:
473
473
        f.write("""\
474
474
from bzrlib import commands
475
475
class cmd_myplug(commands.Command):
476
 
    '''Just a simple test plugin.'''
 
476
    __doc__ = '''Just a simple test plugin.'''
477
477
    aliases = ['mplg']
478
478
    def run(self):
479
479
        print 'Hello from my plugin'
780
780
        self.overrideAttr(plugin, '_loaded', False)
781
781
        plugin.load_plugins(['.'])
782
782
        self.assertPluginKnown('test_foo')
783
 
        self.assertEqual("This is the doc for test_foo",
784
 
                         bzrlib.plugins.test_foo.__doc__)
 
783
        self.assertDocstring("This is the doc for test_foo",
 
784
                             bzrlib.plugins.test_foo)
785
785
 
786
786
    def test_not_loaded(self):
787
787
        self.warnings = []
814
814
 
815
815
    def assertTestFooLoadedFrom(self, dir):
816
816
        self.assertPluginKnown('test_foo')
817
 
        self.assertEqual('This is the doc for test_foo',
818
 
                         bzrlib.plugins.test_foo.__doc__)
 
817
        self.assertDocstring('This is the doc for test_foo',
 
818
                             bzrlib.plugins.test_foo)
819
819
        self.assertEqual(dir, bzrlib.plugins.test_foo.dir_source)
820
820
 
821
821
    def test_regular_load(self):