diff --git a/shaker/agent/agent.py b/shaker/agent/agent.py index 071e385..3fbad92 100644 --- a/shaker/agent/agent.py +++ b/shaker/agent/agent.py @@ -169,5 +169,6 @@ def main(): work(agent_id, endpoint, polling_interval) + if __name__ == "__main__": main() diff --git a/shaker/engine/all_in_one.py b/shaker/engine/all_in_one.py index e900ce0..4c2f814 100644 --- a/shaker/engine/all_in_one.py +++ b/shaker/engine/all_in_one.py @@ -61,5 +61,6 @@ def main(): LOG.info('Cleaning up') image_builder.cleanup() + if __name__ == "__main__": main() diff --git a/shaker/engine/config.py b/shaker/engine/config.py index 939d2f5..8b12a9e 100644 --- a/shaker/engine/config.py +++ b/shaker/engine/config.py @@ -37,7 +37,7 @@ class Endpoint(types.String): def __call__(self, value): value = str(value) - if not re.match('\S+:\d+', value): + if not re.match(r'\S+:\d+', value): raise ValueError('Wrong value of server_endpoint, ' 'expected <host>:<port>, but got: %s' % value) return value diff --git a/shaker/tests/test_sla.py b/shaker/tests/test_sla.py index 419ecaf..0fd934c 100644 --- a/shaker/tests/test_sla.py +++ b/shaker/tests/test_sla.py @@ -28,10 +28,10 @@ class TestSla(testtools.TestCase): self.assertFalse(sla.eval_expr('(not 11 > 7) or (not 5 < 6)')) def test_eval_regex(self): - self.assertTrue(sla.eval_expr('"some text" & "\w+\s+\w+"')) - self.assertFalse(sla.eval_expr('"some text" & "\d+"')) + self.assertTrue(sla.eval_expr(r'"some text" & "\w+\s+\w+"')) + self.assertFalse(sla.eval_expr(r'"some text" & "\d+"')) - self.assertFalse(sla.eval_expr('a & "\d+"', {'a': ''})) + self.assertFalse(sla.eval_expr(r'a & "\d+"', {'a': ''})) def test_eval_non_existent_ref(self): self.assertRaises(sla.SLAException, sla.eval_expr, diff --git a/test-requirements.txt b/test-requirements.txt index 459d014..55eeb2d 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -2,14 +2,14 @@ # of appearance. Changing the order has an impact on the overall integration # process, which may cause wedges in the gate later. -# Hacking already pins down pep8, pyflakes and flake8 coverage>=4.0 # Apache-2.0 -hacking<1.2.0,>=1.1.0 # Apache-2.0 - should be in sync with diskimage-builder +flake8<4.0.0,>=3.6.0 # MIT - must be in sync with diskimage-builder mock>=2.0 # BSD oslotest>=1.10.0 # Apache-2.0 sphinx!=1.6.6,!=1.6.7,<2.0.0;python_version=='2.7' # BSD sphinx!=1.6.6,!=1.6.7;python_version>='3.4' # BSD sphinxcontrib-httpdomain # BSD sphinx_rtd_theme -stestr>=2.0.0 # Apache-2.0 +stestr>=2.0.0,<3.0.0;python_version=='2.7' # Apache-2.0 +stestr>=2.0.0;python_version>='3.4' # Apache-2.0 testtools>=1.4.0 # MIT diff --git a/tox.ini b/tox.ini index d549c7a..148026f 100644 --- a/tox.ini +++ b/tox.ini @@ -91,9 +91,8 @@ commands = bash tools/svg2png.sh # E125 continuation line does not distinguish itself from next logical line # H405 multi line docstring summary not separated with an empty line # E731 do not assign a lambda expression, use a def -# [H106] Don't put vim configuration in source files -# [H203] Use assertIs(Not)None to check for None -ignore = E125,H405,E731 +# W504 line break after binary operator +ignore = E125,H405,E731,W504 show-source = true builtins = _ exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,tools,build