From 664c72d291e0c8f62538e837f126fdbcb7db2367 Mon Sep 17 00:00:00 2001 From: Raphael Pierzina Date: Mon, 9 Nov 2015 00:02:07 +0100 Subject: [PATCH] Implement test for flake8 compliance --- tests/test_cookiecutter_generation.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tests/test_cookiecutter_generation.py b/tests/test_cookiecutter_generation.py index 650d4e1f..74f8947c 100644 --- a/tests/test_cookiecutter_generation.py +++ b/tests/test_cookiecutter_generation.py @@ -2,6 +2,7 @@ import os import re +import sh import pytest from binaryornot.check import is_binary @@ -34,7 +35,7 @@ def build_files_list(root_dir): for file_path in files ] - + def check_paths(paths): """Method to check all paths have correct substitutions, used by other tests cases @@ -77,3 +78,13 @@ def test_enabled_features(cookies, feature_context): paths = build_files_list(str(result.project)) assert paths check_paths(paths) + + +def test_flake8_compliance(cookies): + """generated project should pass flake8""" + result = cookies.bake() + + try: + sh.flake8(str(result.project)) + except sh.ErrorReturnCode as e: + pytest.fail(e)