From 30ced9a546e7fc1c1b9f7ae0573b163678887f6e Mon Sep 17 00:00:00 2001 From: Tyler Cheek Date: Mon, 10 Oct 2022 09:45:01 -0400 Subject: [PATCH] Coverage and Makefile improvements (#267) * Update Makefile so PYTHONPATH isn't necessary * Add PYTHONPATH as an exported var in Makefile * Remove echo --- .coveragerc | 9 +++++++++ Makefile | 7 +++++-- 2 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 .coveragerc diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 00000000..6deec938 --- /dev/null +++ b/.coveragerc @@ -0,0 +1,9 @@ +[run] +include = + src/** + +omit = + **/__init__.py + **/_version.py + src/dug/config.py + src/dug/hookspecs.py \ No newline at end of file diff --git a/Makefile b/Makefile index 170d70c4..65fa9442 100644 --- a/Makefile +++ b/Makefile @@ -6,6 +6,7 @@ DOCKER_OWNER = helxplatform DOCKER_APP = dug DOCKER_TAG = ${VERSION} DOCKER_IMAGE = ${DOCKER_OWNER}/${DOCKER_APP}:$(DOCKER_TAG) +export PYTHONPATH = $(shell echo ${PWD})/src .DEFAULT_GOAL = help @@ -27,13 +28,15 @@ clean: install: ${PYTHON} -m pip install --upgrade pip ${PYTHON} -m pip install -r requirements.txt - ${PYTHON} -m pip install . #test: Run all tests test: # ${PYTHON} -m flake8 src ${PYTHON} -m pytest --doctest-modules src - ${PYTHON} -m pytest tests + coverage run -m pytest tests + +coverage: + coverage report #build: Build Docker image build: