diff options
| author | Dan Prince <dprince@redhat.com> | 2013-03-22 15:12:35 -0400 |
|---|---|---|
| committer | Dan Prince <dprince@redhat.com> | 2013-03-22 15:52:50 -0400 |
| commit | 7a9ce26aaf03459a7ea367fbdb91d91626a1ee93 (patch) | |
| tree | 719dc83b4153223f34143dbf85a7b785c53ba8ae /tools | |
| parent | a92b7c8f9281cb2dcf8eb6d6a7c466a463719352 (diff) | |
| download | nova-7a9ce26aaf03459a7ea367fbdb91d91626a1ee93.tar.gz nova-7a9ce26aaf03459a7ea367fbdb91d91626a1ee93.tar.xz nova-7a9ce26aaf03459a7ea367fbdb91d91626a1ee93.zip | |
py2.6 doesn't support TextTestRunner resultclass
Updates tools/colorizer to account for the fact that Python
2.6 doesn't support resultclass.
This fixes issue in trying to use run_tests.sh on distributions
which use python 2.6.
Fixes LP Bug #1158940
Change-Id: I763cd9c7a4b5ec5baaad3a3d9ee96e6e3cd13b3e
Diffstat (limited to 'tools')
| -rwxr-xr-x | tools/colorizer.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tools/colorizer.py b/tools/colorizer.py index 50534d3fb..2df3c2bf8 100755 --- a/tools/colorizer.py +++ b/tools/colorizer.py @@ -304,8 +304,12 @@ class NovaTestResult(testtools.TestResult): test = subunit.ProtocolTestCase(sys.stdin, passthrough=None) -runner = unittest.TextTestRunner(verbosity=2, - resultclass=NovaTestResult) + +if sys.version_info <= (2, 6): + runner = unittest.TextTestRunner(verbosity=2) +else: + runner = unittest.TextTestRunner(verbosity=2, resultclass=NovaTestResult) + if runner.run(test).wasSuccessful(): exit_code = 0 else: |
