Add rudimentary pytests

This commit is contained in:
Milan Stute
2019-12-17 23:10:47 +01:00
parent 3edb379a6a
commit a714545fb2
4 changed files with 49 additions and 12 deletions
+9 -12
View File
@@ -1,4 +1,4 @@
.PHONY: ci checkformat lint install run autoformat
.PHONY: ci checkformat lint test run autoformat
VENV_NAME?=venv
VENV_ACTIVATE=. $(VENV_NAME)/bin/activate
@@ -11,24 +11,21 @@ venv: $(VENV_NAME)/bin/activate
$(VENV_NAME)/bin/activate: setup.py requirements-dev.txt Makefile
test -d $(VENV_NAME) || virtualenv -p python3 $(VENV_NAME)
$(PYTHON) -m pip install -U pip
$(PYTHON) -m pip install --upgrade pip
$(PYTHON) -m pip install -r requirements-dev.txt
$(PYTHON) -m pip install -e .
touch $(VENV_NAME)/bin/activate
ci: checkformat lint install
ci: checkformat lint test
checkformat:
$(PYTHON) -m yapf --diff -r setup.py $(PROJECT)
checkformat: venv
$(PYTHON) -m yapf . -r --diff --exclude $(VENV_NAME)
lint: venv
$(PYTHON) -m flake8 --statistics --show-source setup.py $(PROJECT)
$(PYTHON) -m flake8 . --count --show-source --statistics --exclude $(VENV_NAME)
install: venv
$(PYTHON) -m pip install .
run: install
$(VENV_NAME)/bin/$(PROJECT) receive
test: venv
$(PYTHON) -m pytest
autoformat: venv
$(PYTHON) -m yapf -i -r setup.py $(PROJECT)
$(PYTHON) -m yapf . -r --in-place --exclude $(VENV_NAME)