Merge lp:~vila/u1-test-utils/1172265-display-pep8-failures into lp:u1-test-utils

Proposed by Vincent Ladeuil
Status: Merged
Approved by: Vincent Ladeuil
Approved revision: 51
Merged at revision: 58
Proposed branch: lp:~vila/u1-test-utils/1172265-display-pep8-failures
Merge into: lp:u1-test-utils
Diff against target: 34 lines (+1/-8)
1 file modified
u1testutils/static/test_pep8_conformance.py (+1/-8)
To merge this branch: bzr merge lp:~vila/u1-test-utils/1172265-display-pep8-failures
Reviewer Review Type Date Requested Status
Leo Arias (community) code review, tested in real life Approve
Review via email: mp+160635@code.launchpad.net

Commit message

Display pep8 failures as they occur.

Description of the change

This fixes bug #1172265 by displaying pep8 failures as they occur.

An alternate and more invasive fix would be to collect errors and have them
displayed when the test failure is reported.

I postponed that additional fix as some infrastructure a la testtools
addDetail sounds like a perfect match and I don't want to re-invent the
wheel here. Should the need arise though, I'd rather have testtools as a
dependency first (after all, sst is a dependency here and uses testtools
itself).

To post a comment you must log in.
Revision history for this message
Leo Arias (elopio) :
review: Approve (code review, tested in real life)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'u1testutils/static/test_pep8_conformance.py'
2--- u1testutils/static/test_pep8_conformance.py 2012-12-03 17:52:45 +0000
3+++ u1testutils/static/test_pep8_conformance.py 2013-04-24 13:09:05 +0000
4@@ -25,22 +25,17 @@
5 packages = []
6 exclude = []
7
8- def message(self, text):
9- self.errors.append(text)
10-
11 def setUp(self):
12- self.errors = {}
13 self.pep8style = pep8.StyleGuide(
14 counters=defaultdict(int),
15 doctest='',
16 exclude=self.exclude,
17 filename=['*.py'],
18 ignore=[],
19- messages=self.errors,
20 repeat=True,
21 select=[],
22 show_pep8=False,
23- show_source=False,
24+ show_source=True,
25 max_line_length=79,
26 quiet=0,
27 statistics=False,
28@@ -51,6 +46,4 @@
29 def test_pep8_conformance(self):
30 for package in self.packages:
31 self.pep8style.input_dir(os.path.dirname(package.__file__))
32- # FIXME: When this fails, the offending lines are not displayed, they
33- # should. -- vila 2012-10-19
34 self.assertEqual(self.pep8style.options.report.total_errors, 0)

Subscribers

People subscribed via source and target branches

to all changes: