~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_selftest.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-04-23 11:11:22 UTC
  • mfrom: (5177.1.1 integration2)
  • Revision ID: pqm@pqm.ubuntu.com-20100423111122-a5zc2qm7v9qrcxmf
(vila, for gz) Manually assign docstrings to command objects,
        so that they work with python -OO

Show diffs side-by-side

added added

removed removed

Lines of Context:
2773
2773
        # Test that a plausible list of modules to doctest is returned
2774
2774
        # by _test_suite_modules_to_doctest.
2775
2775
        test_list = tests._test_suite_modules_to_doctest()
 
2776
        if __doc__ is None:
 
2777
            # When docstrings are stripped, there are no modules to doctest
 
2778
            self.assertEqual([], test_list)
 
2779
            return
2776
2780
        self.assertSubset([
2777
2781
            'bzrlib.timestamp',
2778
2782
            ],
2795
2799
        self.overrideAttr(tests, '_test_suite_testmod_names', testmod_names)
2796
2800
        def doctests():
2797
2801
            calls.append("modules_to_doctest")
 
2802
            if __doc__ is None:
 
2803
                return []
2798
2804
            return ['bzrlib.timestamp']
2799
2805
        self.overrideAttr(tests, '_test_suite_modules_to_doctest', doctests)
2800
2806
        expected_test_list = [
2803
2809
            ('bzrlib.tests.per_transport.TransportTests'
2804
2810
             '.test_abspath(LocalTransport,LocalURLServer)'),
2805
2811
            'bzrlib.tests.test_selftest.TestTestSuite.test_test_suite',
2806
 
            # modules_to_doctest
2807
 
            'bzrlib.timestamp.format_highres_date',
2808
2812
            # plugins can't be tested that way since selftest may be run with
2809
2813
            # --no-plugins
2810
2814
            ]
 
2815
        if __doc__ is not None:
 
2816
            expected_test_list.extend([
 
2817
                # modules_to_doctest
 
2818
                'bzrlib.timestamp.format_highres_date',
 
2819
                ])
2811
2820
        suite = tests.test_suite()
2812
2821
        self.assertEqual(set(["testmod_names", "modules_to_doctest"]),
2813
2822
            set(calls))