From d0fb8753f4b46b079110720ee0b78d6bff4431c3 Mon Sep 17 00:00:00 2001 From: Robert Dargavel Smith Date: Mon, 13 Sep 2021 13:58:30 +0100 Subject: [PATCH] add flake8 to pre-commit tests --- backend/test_deejai.py | 1 - run_tests.sh | 10 ++++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/backend/test_deejai.py b/backend/test_deejai.py index 761fc6d..a44d00b 100644 --- a/backend/test_deejai.py +++ b/backend/test_deejai.py @@ -1,6 +1,5 @@ """Unit tests using pytest. """ -import os import json import asyncio from datetime import datetime diff --git a/run_tests.sh b/run_tests.sh index 6abe954..75fc386 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -1,6 +1,8 @@ #!/bin/sh -export SQLALCHEMY_DATABASE_URL="sqlite:///:memory:" -export CUDA_VISIBLE_DEVICES="" -pipenv run "pytest backend" -export CI=true +pipenv run flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics && \ +pipenv run flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics && \ +export SQLALCHEMY_DATABASE_URL="sqlite:///:memory:" && \ +export CUDA_VISIBLE_DEVICES="" && \ +pipenv run "pytest backend" &&\ +export CI=true && \ yarn test \ No newline at end of file