#!/bin/bash

set -e

# run linting of python files
echo 'Running linting...'

flake8 {{cookiecutter.app_name}}/ tests/ application.py dev.py
isort --check {{cookiecutter.app_name}}/ tests/ application.py dev.py
black --check {{cookiecutter.app_name}}/ tests/ application.py dev.py

# run pytest with args set
echo 'Running tests...'
PYTHONDONTWRITEBYTECODE=1 COVERAGE_FILE=build/.coverage python -m pytest -v tests/unit/ \
		-p no:cacheprovider \
		--cov {{cookiecutter.app_name}} \
		--cov-report xml:build/coverage.xml \
		--cov-report term \
		--junitxml=build/pyunit.xml

echo 'Done!'
