From 26a2c2dda02dbde7efc68feb545fc2862bf0f48f Mon Sep 17 00:00:00 2001 From: jo Date: Wed, 29 Jun 2022 14:40:37 +0200 Subject: [PATCH] chore: update python tests target --- api/Makefile | 13 +++++++++++-- tools/python.mk | 8 +++++++- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/api/Makefile b/api/Makefile index 2c81bb1ca..692bfe5ad 100644 --- a/api/Makefile +++ b/api/Makefile @@ -13,12 +13,21 @@ clean: .clean test: $(VENV) source $(VENV)/bin/activate - DJANGO_SETTINGS_MODULE=libretime_api.settings.testing pytest -n $(CPU_CORES) --color=yes -v libretime_api + export DJANGO_SETTINGS_MODULE=libretime_api.settings.testing + pytest -v \ + --numprocesses=$(CPU_CORES) \ + --color=yes \ + --cov-config=pyproject.toml \ + --cov-report=term \ + --cov-report=xml:./coverage.xml \ + --cov=libretime_api \ + libretime_api SCHEMA_FILE ?= schema.yml schema: $(VENV) source $(VENV)/bin/activate - DJANGO_SETTINGS_MODULE=libretime_api.settings.testing libretime-api spectacular --file $(SCHEMA_FILE) + export DJANGO_SETTINGS_MODULE=libretime_api.settings.testing + libretime-api spectacular --file $(SCHEMA_FILE) if command -v npx > /dev/null; then npx prettier --write $(SCHEMA_FILE); fi schema-foreach-commit: diff --git a/tools/python.mk b/tools/python.mk index be109f21b..3f60af304 100644 --- a/tools/python.mk +++ b/tools/python.mk @@ -63,7 +63,13 @@ install: $(VENV) .PHONY: .pytest .pytest: $(VENV) source $(VENV)/bin/activate - pytest -n $(CPU_CORES) --color=yes -v --cov-report term --cov-report xml:./coverage.xml $(PYTEST_ARG) + pytest -v \ + --numprocesses=$(CPU_CORES) \ + --color=yes \ + --cov-config=pyproject.toml \ + --cov-report=term \ + --cov-report=xml:./coverage.xml \ + $(PYTEST_ARG) .PHONY: .clean .clean: