From aa548e9452d62def8dd3f30ba20b938d45dfaa15 Mon Sep 17 00:00:00 2001 From: Marius Gedminas Date: Fri, 12 Apr 2019 22:02:35 +0300 Subject: [PATCH] Fix flake8 warnings --- Makefile | 4 ++++ setup.cfg | 3 +++ test_profilehooks.py | 5 +++-- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index e2c8554..de72559 100644 --- a/Makefile +++ b/Makefile @@ -10,6 +10,10 @@ FILE_WITH_CHANGELOG = CHANGES.rst default: @echo "Nothing to build here" +.PHONY: flake8 +flake8: + flake8 *.py + .PHONY: test check test check: $(PYTHON) test_profilehooks.py diff --git a/setup.cfg b/setup.cfg index 0b2e547..4dba586 100644 --- a/setup.cfg +++ b/setup.cfg @@ -3,6 +3,9 @@ universal = 1 [flake8] doctests = yes +# some doctests in test_profilehooks.py are long and I see no clean way of +# wrapping them +max-line-length = 100 [zest.releaser] python-file-with-version = profilehooks.py diff --git a/test_profilehooks.py b/test_profilehooks.py index 34a6e5e..b288dae 100644 --- a/test_profilehooks.py +++ b/test_profilehooks.py @@ -139,7 +139,9 @@ def sample_fn_2(self): """.format(linenumber))) + if profilehooks.hotshot is not None: + class TestCoverageWithHotShot(TestCoverage): decorator = staticmethod(profilehooks.coverage_with_hotshot) @@ -559,7 +561,7 @@ def additional_tests(): return unittest.TestSuite([ unittest.defaultTestLoader.loadTestsFromName(__name__), doctest.DocTestSuite(setUp=setUp, tearDown=tearDown, - optionflags=optionflags), + optionflags=optionflags), ]) @@ -568,4 +570,3 @@ def additional_tests(): __name__ = 'test_profilehooks' sys.modules[__name__] = sys.modules['__main__'] unittest.main(defaultTest='additional_tests') -