8 Commits

Author SHA1 Message Date
Victor Stinner
51f443ec4e Don't use dict.iterkeys()
Iterating on a dictionary iterators on its keys, so calling its
iterkeys() method is not needed.

Moreover, the dict.iterkeys() method is gone in Python 3. This change
makes the modified code compatible with Python 3.

Blueprint nova-python3
Change-Id: I140f499d2054bb7d5486e4c61a2f886be6649cbb
2015-05-21 14:52:53 -07:00
Balazs Gibizer
687e8664a2 Enable pep8 on ./tools directory
This patch fixes the pep8 issues of the tool scripts and
configures tox to run pep8 on the tools directory.

Two hacking rules have been modified to ignore the tool directory as both
rules are checking oslo usage which is not critical in case of tools
- N310 use timeutils instead of datetime module
- N324 use jsonutils instead of json module

The tools/xenserver directory is still excluded from pep8 as it contains
scripts that are expected to run on dom0 with python2.4 therefore the
following rules cannot be meaningfully followed
- H231  Python 3.x incompatible 'except x,y:' construct
- H233  Python 3.x incompatible use of print operator

Change-Id: Icfd9e708a2ca1e421676b410e41807b2e630718f
2014-11-25 11:42:02 +01:00
liu-sheng
74f953a1d7 Remove vi modelines
We don't need to have the vi modelines in each source file,
it can be set in a user's vimrc if required.

Also a check is added to hacking to detect if they are re-added.

Change-Id: I347307a5145b2760c69085b6ca850d6a9137ffc6
Closes-Bug: #1229324
2014-02-03 14:19:44 +00:00
Michael Kerrin
c182319039 Fix colorizier thowing exception when a test fails
This failure in colorizier was hidding the actual error
in the tests. If we ran enough tests it also became difficult
to see which test had actually failed.

Fixes: bug 1183602

Change-Id: I806da8f13040b38258de7f3e0fa7b62700bdcead
2013-05-29 13:53:22 +00:00
Joshua Harlow
9ae5313bea Fix the python version comparison.
The comparison to (2, 6) doesn't seem to be correct.

For example:

>>> import sys
>>> sys.version_info <= (2, 6)
False
>>> sys.version_info[0:2] <= (2, 6)
True
>>> sys.version_info
(2, 6, 6, 'final', 0)

Change-Id: I2076d23e58a8777fe4bab81665b9b570656561e9
2013-04-01 15:44:13 -07:00
Vishvananda Ishaya
89c501ec13 Bring back colorizer again with error results.
This was actually a pretty simple fix. When I switched the base
test result class to testtools I lost the methods that were
printing out the errors at the end. This adds the (colorized!)
methods so errors print successfully.

fixes bug 1159116

Change-Id: Ib09d7e18ddf27015ff735a30137421d865382359
2013-03-26 17:59:08 -07:00
Dan Prince
7a9ce26aaf 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
2013-03-22 15:52:50 -04:00
Vishvananda Ishaya
8cd5f862ac Bring back sexy colorized test results.
Also attempt to keep test results together and print out a nice
display of the ten slowest tests.

Change-Id: Ib54eb6dede8650ebafc3f069ee7b4a8c4c1a523c
2013-03-20 19:23:16 -07:00