Merge lp:~gz/juju-ci-tools/trivial_misc_lint into lp:juju-ci-tools

Proposed by Martin Packman
Status: Merged
Merged at revision: 1516
Proposed branch: lp:~gz/juju-ci-tools/trivial_misc_lint
Merge into: lp:juju-ci-tools
Diff against target: 82 lines (+13/-16)
4 files modified
concurrently.py (+0/-1)
tests/test_concurrently.py (+9/-11)
tests/test_industrial_test.py (+2/-2)
tests/test_jujupy.py (+2/-2)
To merge this branch: bzr merge lp:~gz/juju-ci-tools/trivial_misc_lint
Reviewer Review Type Date Requested Status
Curtis Hovey (community) code Approve
Review via email: mp+300939@code.launchpad.net

Commit message

Fix a selection of lint errors

Description of the change

Not *all* of these are my bad... but a bunch are. Note the removal of a patch in the concurretly tests which is just never reached now the errors are caught at the argument parsing stage.

There is still a bunch of:

 E126 continuation line over-indented for hanging indent

But... I'm not sure I want to dive into that as some of it is certainly preference-based.

To post a comment you must log in.
Revision history for this message
Curtis Hovey (sinzui) wrote :

Thank you.

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'concurrently.py'
2--- concurrently.py 2016-07-21 09:49:11 +0000
3+++ concurrently.py 2016-07-22 18:42:12 +0000
4@@ -9,7 +9,6 @@
5 import subprocess
6 import shlex
7 import sys
8-import traceback
9
10 from utility import configure_logging
11
12
13=== modified file 'tests/test_concurrently.py'
14--- tests/test_concurrently.py 2016-07-21 14:23:31 +0000
15+++ tests/test_concurrently.py 2016-07-22 18:42:12 +0000
16@@ -37,20 +37,18 @@
17 self.assertIn('ValueError: bad', self.log_stream.getvalue())
18
19 def test_bad_task_missing_name(self):
20- with patch('concurrently.run_all', autospec=True) as r_mock:
21- with parse_error(self) as err_stream:
22- concurrently.main(['-v', 'bad'])
23- self.assertIn(
24- "invalid task_definition value: 'bad'", err_stream.getvalue())
25+ with parse_error(self) as err_stream:
26+ concurrently.main(['-v', 'bad'])
27+ self.assertIn(
28+ "invalid task_definition value: 'bad'", err_stream.getvalue())
29 self.assertEqual('', self.log_stream.getvalue())
30
31 def test_bad_task_bad_lex(self):
32- with patch('concurrently.run_all', autospec=True) as r_mock:
33- with parse_error(self) as err_stream:
34- concurrently.main(['-v', 'wrong="command'])
35- self.assertIn(
36- """invalid task_definition value: 'wrong="command'""",
37- err_stream.getvalue())
38+ with parse_error(self) as err_stream:
39+ concurrently.main(['-v', 'wrong="command'])
40+ self.assertIn(
41+ """invalid task_definition value: 'wrong="command'""",
42+ err_stream.getvalue())
43 self.assertEqual('', self.log_stream.getvalue())
44
45 def test_max_failure_returncode(self):
46
47=== modified file 'tests/test_industrial_test.py'
48--- tests/test_industrial_test.py 2016-07-05 14:15:27 +0000
49+++ tests/test_industrial_test.py 2016-07-22 18:42:12 +0000
50@@ -1185,8 +1185,8 @@
51
52 def FakeEnvJujuClient(name='steve', version='1.2', full_path='/jbin/juju'):
53 return EnvJujuClient(
54- JujuData(name, {'type': 'fake', 'region': 'regionx'}),
55- version, full_path)
56+ JujuData(name, {'type': 'fake', 'region': 'regionx'}),
57+ version, full_path)
58
59
60 class FakeEnvJujuClient1X(EnvJujuClient1X):
61
62=== modified file 'tests/test_jujupy.py'
63--- tests/test_jujupy.py 2016-07-22 18:12:55 +0000
64+++ tests/test_jujupy.py 2016-07-22 18:42:12 +0000
65@@ -5826,7 +5826,7 @@
66 'juju-status': {
67 'current': 'error',
68 'message': failure}
69- },
70+ },
71 }
72 }, '')
73 with self.assertRaises(ErroredUnit) as e_cxt:
74@@ -5848,7 +5848,7 @@
75 'juju-status': {
76 'current': 'error',
77 'message': failure}
78- },
79+ },
80 }
81 }, '')
82 with self.assertRaises(ErroredUnit) as e_cxt:

Subscribers

People subscribed via source and target branches