diff options
author | Dieter Verfaillie <dieterv@optionexplicit.be> | 2013-04-24 14:06:18 +0200 |
---|---|---|
committer | Dieter Verfaillie <dieterv@optionexplicit.be> | 2013-05-07 23:38:22 +0200 |
commit | c9e2d880011c530ff1454fe31a2d40d189860be5 (patch) | |
tree | 9acdf7d7cf409ffd8d0f7967ebf9d03497d31269 /tests | |
parent | a031129d8ab28e2f51e95e7266f1274bdc592557 (diff) | |
download | gobject-introspection-c9e2d880011c530ff1454fe31a2d40d189860be5.tar.gz |
tests: Update misc/pep8.py to 1.4.5
Version in our tree is a wee bit outdated. For example,
later work will introduce an utf8 encoded python source
file which our old pep8.py does not yet understand (yeah,
it really was *that* ancient)...
Updated from:
https://raw.github.com/jcrocholl/pep8/1.4.5/pep8.py
Takes 552c1f1525e37a30376790151c1ba437776682c5,
f941537d1c0a40f0906490ed160db6c79af572d3,
5a4afe2a77d0ff7d9fea13dd93c3304a6ca993de and
a17f157e19bd6792c00321c8020dca5e5a281f45 into account...
https://bugzilla.gnome.org/show_bug.cgi?id=699535
Diffstat (limited to 'tests')
-rw-r--r-- | tests/scanner/annotationparser/test_parser.py | 3 | ||||
-rw-r--r-- | tests/warn/warningtester.py | 16 |
2 files changed, 11 insertions, 8 deletions
diff --git a/tests/scanner/annotationparser/test_parser.py b/tests/scanner/annotationparser/test_parser.py index a1c5866c..ce3ccd22 100644 --- a/tests/scanner/annotationparser/test_parser.py +++ b/tests/scanner/annotationparser/test_parser.py @@ -108,7 +108,7 @@ def parsed2tree(docblock): parsed += ' <annotations>\n' for key, value in tag.options.values: parsed += ' <annotation>\n' - parsed += ' <name>%s</name>\n' %(key, ) + parsed += ' <name>%s</name>\n' % (key, ) if value is not None: options = value.all() parsed += ' <options>\n' @@ -130,6 +130,7 @@ def parsed2tree(docblock): return parsed + def expected2tree(docblock): # Note: this sucks, but we can't rely on etree.tostring() to generate useable output :( diff --git a/tests/warn/warningtester.py b/tests/warn/warningtester.py index 27e0a5e6..fc3c3d2d 100644 --- a/tests/warn/warningtester.py +++ b/tests/warn/warningtester.py @@ -61,23 +61,24 @@ def _diff(a, b): for line in a[i1:i2]: for l in line.split('\n'): if l != '': - retval += ' ' + l + '\n' + retval += ' ' + l + '\n' continue if tag in ('replace', 'delete'): for line in a[i1:i2]: for l in line.split('\n'): if l != '': - retval += '-' + l + '\n' + retval += '-' + l + '\n' if tag in ('replace', 'insert'): for line in b[j1:j2]: for l in line.split('\n'): if l != '': - retval += '+' + l + '\n' + retval += '+' + l + '\n' return retval + def _extract_expected(filename): fd = open(filename, 'rU') data = fd.read() @@ -92,6 +93,7 @@ def _extract_expected(filename): return retval + def check(args): filename = args[0] @@ -133,10 +135,10 @@ def check(args): if len(expected_warnings) != len(emitted_warnings): raise SystemExit('ERROR in %r: %d warnings were emitted, ' - 'expected %d:\n%s' %(os.path.basename(filename), - len(emitted_warnings), - len(expected_warnings), - _diff(expected_warnings, emitted_warnings))) + 'expected %d:\n%s' % (os.path.basename(filename), + len(emitted_warnings), + len(expected_warnings), + _diff(expected_warnings, emitted_warnings))) for emitted_warning, expected_warning in zip(emitted_warnings, expected_warnings): if expected_warning != emitted_warning: |