~bzr/bzr/bzr.1.5

« back to all changes in this revision

Viewing changes to bzrlib/tests/__init__.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2008-05-08 23:03:13 UTC
  • mfrom: (3394.3.2 trunk)
  • Revision ID: pqm@pqm.ubuntu.com-20080508230313-knn3ibom6wt27w5k
(vila) Make the test suite use the new test loader

Show diffs side-by-side

added added

removed removed

Lines of Context:
108
108
default_transport = LocalURLServer
109
109
 
110
110
 
111
 
def packages_to_test():
112
 
    """Return a list of packages to test.
113
 
 
114
 
    The packages are not globally imported so that import failures are
115
 
    triggered when running selftest, not when importing the command.
116
 
    """
117
 
    import bzrlib.doc
118
 
    import bzrlib.tests.blackbox
119
 
    import bzrlib.tests.branch_implementations
120
 
    import bzrlib.tests.bzrdir_implementations
121
 
    import bzrlib.tests.commands
122
 
    import bzrlib.tests.interrepository_implementations
123
 
    import bzrlib.tests.interversionedfile_implementations
124
 
    import bzrlib.tests.intertree_implementations
125
 
    import bzrlib.tests.inventory_implementations
126
 
    import bzrlib.tests.per_lock
127
 
    import bzrlib.tests.repository_implementations
128
 
    import bzrlib.tests.revisionstore_implementations
129
 
    import bzrlib.tests.tree_implementations
130
 
    import bzrlib.tests.workingtree_implementations
131
 
    return [
132
 
            bzrlib.doc,
133
 
            bzrlib.tests.blackbox,
134
 
            bzrlib.tests.branch_implementations,
135
 
            bzrlib.tests.bzrdir_implementations,
136
 
            bzrlib.tests.commands,
137
 
            bzrlib.tests.interrepository_implementations,
138
 
            bzrlib.tests.interversionedfile_implementations,
139
 
            bzrlib.tests.intertree_implementations,
140
 
            bzrlib.tests.inventory_implementations,
141
 
            bzrlib.tests.per_lock,
142
 
            bzrlib.tests.repository_implementations,
143
 
            bzrlib.tests.revisionstore_implementations,
144
 
            bzrlib.tests.tree_implementations,
145
 
            bzrlib.tests.workingtree_implementations,
146
 
            ]
147
 
 
148
 
 
149
111
class ExtendedTestResult(unittest._TextTestResult):
150
112
    """Accepts, reports and accumulates the results of running tests.
151
113
 
2647
2609
    suite on a global basis, but it is not encouraged.
2648
2610
    """
2649
2611
    testmod_names = [
 
2612
                   'bzrlib.doc',
2650
2613
                   'bzrlib.util.tests.test_bencode',
 
2614
                   'bzrlib.tests.blackbox',
 
2615
                   'bzrlib.tests.branch_implementations',
 
2616
                   'bzrlib.tests.bzrdir_implementations',
 
2617
                   'bzrlib.tests.commands',
 
2618
                   'bzrlib.tests.inventory_implementations',
 
2619
                   'bzrlib.tests.interrepository_implementations',
 
2620
                   'bzrlib.tests.intertree_implementations',
 
2621
                   'bzrlib.tests.interversionedfile_implementations',
 
2622
                   'bzrlib.tests.per_lock',
 
2623
                   'bzrlib.tests.repository_implementations',
 
2624
                   'bzrlib.tests.revisionstore_implementations',
2651
2625
                   'bzrlib.tests.test__dirstate_helpers',
2652
2626
                   'bzrlib.tests.test_ancestry',
2653
2627
                   'bzrlib.tests.test_annotate',
2724
2698
                   'bzrlib.tests.test_permissions',
2725
2699
                   'bzrlib.tests.test_plugins',
2726
2700
                   'bzrlib.tests.test_progress',
 
2701
                   'bzrlib.tests.test_read_bundle',
2727
2702
                   'bzrlib.tests.test_reconfigure',
2728
2703
                   'bzrlib.tests.test_reconcile',
2729
2704
                   'bzrlib.tests.test_registry',
2759
2734
                   'bzrlib.tests.test_transactions',
2760
2735
                   'bzrlib.tests.test_transform',
2761
2736
                   'bzrlib.tests.test_transport',
 
2737
                   'bzrlib.tests.test_transport_implementations',
2762
2738
                   'bzrlib.tests.test_tree',
2763
2739
                   'bzrlib.tests.test_treebuilder',
2764
2740
                   'bzrlib.tests.test_tsort',
2777
2753
                   'bzrlib.tests.test_workingtree_4',
2778
2754
                   'bzrlib.tests.test_wsgi',
2779
2755
                   'bzrlib.tests.test_xml',
 
2756
                   'bzrlib.tests.tree_implementations',
 
2757
                   'bzrlib.tests.workingtree_implementations',
2780
2758
                   ]
2781
 
    test_transport_implementations = [
2782
 
        'bzrlib.tests.test_transport_implementations',
2783
 
        'bzrlib.tests.test_read_bundle',
2784
 
        ]
 
2759
 
2785
2760
    loader = TestUtil.TestLoader()
2786
2761
 
2787
2762
    if keep_only is None:
2794
2769
    # modules building their suite with loadTestsFromModuleNames
2795
2770
    suite.addTest(loader.loadTestsFromModuleNames(testmod_names))
2796
2771
 
2797
 
    # modules adapted for transport implementations
2798
 
    from bzrlib.tests.test_transport_implementations import TransportTestProviderAdapter
2799
 
    adapter = TransportTestProviderAdapter()
2800
 
    adapt_modules(test_transport_implementations, adapter, loader, suite)
2801
 
 
2802
 
    # modules defining their own test_suite()
2803
 
    for package in [p for p in packages_to_test()
2804
 
                    if (keep_only is None
2805
 
                        or id_filter.refers_to(p.__name__))]:
2806
 
        pack_suite = package.test_suite()
2807
 
        suite.addTest(pack_suite)
2808
 
 
2809
2772
    modules_to_doctest = [
2810
2773
        'bzrlib',
2811
2774
        'bzrlib.errors',