/b-gtk/fix-viz

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/b-gtk/fix-viz

« back to all changes in this revision

Viewing changes to __init__.py

  • Committer: Vincent Ladeuil
  • Date: 2009-05-07 09:41:56 UTC
  • Revision ID: v.ladeuil+lp@free.fr-20090507094156-0r49qnwguyednfxh
Upgrade to the new loading tests API.

* tests/__init__.py:
(load_tests): Upgrade to the new loading tests API.

* __init__.py:
(load_tests): Upgrade to the new loading tests API.

Show diffs side-by-side

added added

removed removed

Lines of Context:
102
102
            raise NoDisplayError
103
103
    set_ui_factory()
104
104
    return gtk
105
 
 
 
105
 
106
106
 
107
107
commands = {
108
108
    "gannotate": ["gblame", "gpraise"],
109
109
    "gbranch": [],
110
 
    "gcheckout": [], 
111
 
    "gcommit": ["gci"], 
112
 
    "gconflicts": [], 
 
110
    "gcheckout": [],
 
111
    "gcommit": ["gci"],
 
112
    "gconflicts": [],
113
113
    "gdiff": [],
114
114
    "ginit": [],
115
115
    "ginfo": [],
116
116
    "gmerge": [],
117
 
    "gmissing": [], 
118
 
    "gpreferences": [], 
119
 
    "gpush": [], 
 
117
    "gmissing": [],
 
118
    "gpreferences": [],
 
119
    "gpush": [],
120
120
    "gselftest": [],
121
121
    "gsend": [],
122
122
    "gstatus": ["gst"],
132
132
    commands["gloom"] = []
133
133
 
134
134
for cmd, aliases in commands.iteritems():
135
 
    plugin_cmds.register_lazy("cmd_%s" % cmd, aliases, "bzrlib.plugins.gtk.commands")
 
135
    plugin_cmds.register_lazy("cmd_%s" % cmd, aliases,
 
136
                              "bzrlib.plugins.gtk.commands")
136
137
 
137
138
 
138
139
import gettext
149
150
        return "No DISPLAY. Unable to run GTK+ application."
150
151
 
151
152
 
152
 
def test_suite():
153
 
    from unittest import TestSuite
154
 
    import tests
 
153
def load_tests(basic_tests, module, loader):
 
154
    testmod_names = [
 
155
        'tests',
 
156
        ]
155
157
    import sys
156
158
    default_encoding = sys.getdefaultencoding()
157
159
    try:
158
 
        result = TestSuite()
 
160
        result = basic_tests
159
161
        try:
160
162
            import_pygtk()
161
163
        except errors.BzrCommandError:
162
 
            return result
163
 
        result.addTest(tests.test_suite())
 
164
            return basic_tests
 
165
        basic_tests.addTest(loader.loadTestsFromModuleNames(
 
166
                ["%s.%s" % (__name__, tmn) for tmn in testmod_names]))
164
167
    finally:
165
168
        if sys.getdefaultencoding() != default_encoding:
166
169
            reload(sys)
167
170
            sys.setdefaultencoding(default_encoding)
168
 
    return result
 
171
    return basic_tests