2
# vim: tabstop=4 shiftwidth=4 softtabstop=4
4
# Copyright 2010 United States Government as represented by the
5
# Administrator of the National Aeronautics and Space Administration.
8
# Licensed under the Apache License, Version 2.0 (the "License");
9
# you may not use this file except in compliance with the License.
10
# You may obtain a copy of the License at
12
# http://www.apache.org/licenses/LICENSE-2.0
14
# Unless required by applicable law or agreed to in writing, software
15
# distributed under the License is distributed on an "AS IS" BASIS,
16
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
# See the License for the specific language governing permissions and
18
# limitations under the License.
25
from nose import config
26
from nose import result
29
gettext.install('nova', unicode=1)
31
from nova.db import migration
34
class NovaTestResult(result.TextTestResult):
35
def __init__(self, *args, **kw):
36
result.TextTestResult.__init__(self, *args, **kw)
37
self._last_case = None
39
def getDescription(self, test):
42
def startTest(self, test):
43
unittest.TestResult.startTest(self, test)
44
current_case = test.test.__class__.__name__
47
if current_case != self._last_case:
48
self.stream.writeln(current_case)
49
self._last_case = current_case
52
' %s' % str(test.test._testMethodName).ljust(60))
56
class NovaTestRunner(core.TextTestRunner):
57
def _makeResult(self):
58
return NovaTestResult(self.stream,
64
if __name__ == '__main__':
65
c = config.Config(stream=sys.stdout,
72
runner = NovaTestRunner(stream=c.stream,
73
verbosity=c.verbosity,
75
sys.exit(not core.run(config=c, testRunner=runner))