Commit graph

13 commits

Author SHA1 Message Date
Paul Morgan
a0d0f859c7 resolve another use of commands module for python3 compat
03255001d6 moved commands module to src/tito/compat.py to handle
differences between python2 and python3, but missed a bit that
did not show up in unit or functional tests.

Fix those occurences and add unit test to detect the regression.
2014-03-09 13:12:32 +00:00
Paul Morgan
25c6f7f1e0 avoid ImportError in test suite on python 3
python3 does not allow relative imports.

test/unit/__init.py__ and test/functional/__init.py__ already exist,
which means we can use absolute import on all versions of python
without resorting to http://legacy.python.org/dev/peps/pep-0328/
2014-02-28 15:38:25 +00:00
Paul Morgan
22896be9ce add unit test and use print function for python3 compat
Python 3 does not have the print statement, so convert all
print statements to print functions and add an ugly duckling
unit test to detect regressions.
2014-02-28 15:38:25 +00:00
Paul Morgan
03255001d6 add unit test and module compatibility lib
Add modules compat lib to support both python 2 and 3, and
add unit test to detect regressions.

Tito uses two modules that have changed significantly between
python 2 and 3:

* commands module merged into subprocess module
* ConfigParser module renamed as configparser
2014-02-28 15:38:25 +00:00
Paul Morgan
1182b13713 add unit tests and fix exception clause compatibility
Exceptions are now compatible with both python 2.4 and 3.3,
and we have unit tests to detect regressions.

The syntax for capturing exceptions changed in python 3, but
we need to continue supporting python 2.4 syntax since many
people use tito on RHEL 5, which has python 2.4.

http://docs.python.org/dev/howto/pyporting.html#capturing-the-currently-raised-exception
2014-02-28 15:02:50 +00:00
Paul Morgan
1597d7956a add pep8 tests and fix lexical indentation for python3
These are the pep8 tests that break python3,
such as mixing tabs and spaces for indentation.

I ignored all the pep8 tests that seemed only stylistic,
such as "visual" indentation.

http://docs.python.org/3.3/reference/lexical_analysis.html
2014-02-28 01:34:34 +00:00
Paul Morgan
7846ee875d add pep8 tests and fix redundant backslashes between brackets 2014-02-28 01:34:34 +00:00
Paul Morgan
4fe4ed4de7 add pep8 tests and fix statement errors 2014-02-28 01:34:34 +00:00
Paul Morgan
1a8ac66e06 add pep8 tests for import errors 2014-02-28 01:34:34 +00:00
Paul Morgan
97b29d6c35 add pep8 tests and fix blank line errors and warnings 2014-02-28 01:34:34 +00:00
Paul Morgan
1a772c5995 add pep8 tests and fix whitespace errors and warnings 2014-02-28 01:34:34 +00:00
Paul Morgan
5d336d0ce3 add pep8 tests for deprecated python usage 2014-02-27 21:22:05 +00:00
Paul Morgan
c108f6022a add pep8 tests for syntax errors 2014-02-27 21:22:05 +00:00