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
This commit is contained in:
Paul Morgan 2014-02-15 22:44:11 +00:00
parent 7846ee875d
commit 1597d7956a
11 changed files with 88 additions and 79 deletions

View file

@ -50,7 +50,7 @@ setup(
'Intended Audience :: Information Technology',
'Programming Language :: Python'
],
# test_suite = 'nose.collector',
#test_suite = 'nose.collector',
)

View file

@ -27,6 +27,7 @@ from tempfile import mkdtemp
from tito.common import *
from tito.common import scl_to_rpm_option, get_latest_tagged_version, \
find_wrote_in_rpmbuild_output
from tito.compat import *
from tito.exception import RunCommandException
from tito.release import *
from tito.exception import TitoException

View file

@ -32,12 +32,20 @@ class TestPep8(TitoUnitTestFixture):
def test_conformance(self):
tests = [
# http://pep8.readthedocs.org/en/latest/intro.html#error-codes
'E101', # indentation contains mixed spaces and tabs
'E111', # indentation is not a multiple of four
'E112', # expected an indented block
'E113', # unexpected indentation
'E121', # continuation line indentation is not a multiple of four
'E122', # continuation line missing indentation or outdented
'E126', # continuation line over-indented for hanging indent
'E2', # whitespace errors
'E3', # blank line errors
'E4', # import errors
'E502', # the backslash is redundant between brackets
'E7', # statement errors
'E9', # runtime errors (SyntaxError, IndentationError, IOError)
'W1', # indentation warnings
'W2', # whitespace warnings
'W3', # blank line warnings
'W6', # deprecated features