From 3a13f6644eb4d2df35264231fae2e593c6fe054d Mon Sep 17 00:00:00 2001 From: Kostis Anagnostopoulos Date: Fri, 8 Jun 2018 18:13:15 +0200 Subject: [PATCH] fix(TCs): flake8 complained about examples --- Makefile | 2 +- .../example_with_submodules/example_with_submodules.py | 1 + examples/graphviz/recursive.py | 1 + examples/graphviz/regexp.py | 5 +++-- 4 files changed, 6 insertions(+), 3 deletions(-) mode change 100755 => 100644 examples/graphviz/regexp.py diff --git a/Makefile b/Makefile index 702bda9..e9abc76 100644 --- a/Makefile +++ b/Makefile @@ -28,7 +28,7 @@ tests: flake8 --exclude=__init__.py,memory_profiler.py pycallgraph flake8 --ignore=F403 test - flake8 examples + flake8 examples --exclude=all.py doc: cd docs/examples && ./generate.py diff --git a/examples/graphviz/example_with_submodules/example_with_submodules.py b/examples/graphviz/example_with_submodules/example_with_submodules.py index 2fb6d04..0324c4b 100644 --- a/examples/graphviz/example_with_submodules/example_with_submodules.py +++ b/examples/graphviz/example_with_submodules/example_with_submodules.py @@ -9,5 +9,6 @@ def main(): s2 = SubmoduleTwo() s2.report() + if __name__ == "__main__": main() diff --git a/examples/graphviz/recursive.py b/examples/graphviz/recursive.py index d61a1b1..4043878 100755 --- a/examples/graphviz/recursive.py +++ b/examples/graphviz/recursive.py @@ -20,5 +20,6 @@ def main(): for a in xrange(1, 10): factorial(a) + if __name__ == '__main__': main() diff --git a/examples/graphviz/regexp.py b/examples/graphviz/regexp.py old mode 100755 new mode 100644 index 63bb2c2..4054668 --- a/examples/graphviz/regexp.py +++ b/examples/graphviz/regexp.py @@ -15,11 +15,11 @@ def main(): config = Config(include_stdlib=True) with PyCallGraph(output=graphviz, config=config): - reo = compile() + reo = compile_regex() match(reo) -def compile(): +def compile_regex(): return re.compile('^[abetors]*$') @@ -41,5 +41,6 @@ def words(): 'abrasives', ] + if __name__ == '__main__': main()