aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2023-08-07 13:45:31 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2023-08-07 15:16:41 +0200
commita59af71a77d928536412ea71b20689dfc99dd033 (patch)
treecca2e21ee76fa47364cae883a2ab1d05d310b4cb /Makefile
parentAdd mail relation tree. (diff)
downloadmu4web-a59af71a77d928536412ea71b20689dfc99dd033.tar.gz
mu4web-a59af71a77d928536412ea71b20689dfc99dd033.tar.xz
Add tests.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile15
1 files changed, 13 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 753fe28..09a500c 100644
--- a/Makefile
+++ b/Makefile
@@ -1,13 +1,21 @@
-.PHONY: tags check documentation sphinx-apidoc
+.PHONY: tags check documentation sphinx-apidoc test
DOC_OUTPUT = doc.rendered
+PYTEST_FLAGS = $(if $(shell python -m pytest -VV | grep pytest-cov), \
+ --cov=mu4web --cov-branch --cov-report=html --full-trace)
+
tags:
- ctags `find mu4web -type f -name \*.py `
+ ctags `find mu4web -type f -name '*.py'`
+
+run:
+ python -m mu4web
check:
mypy -p mu4web
flake8 mu4web
+ flake8 test
+ mypy test
sphinx-apidoc:
sphinx-apidoc --separate --force -o doc mu4web
@@ -16,3 +24,6 @@ $(DOC_OUTPUT)/index.html: sphinx-apidoc
sphinx-build -b dirhtml doc $(DOC_OUTPUT)
documentation: $(DOC_OUTPUT)/index.html
+
+test:
+ python -m pytest $(PYTEST_FLAGS) test