From c1bc39f99fe41864aebe3f927be1cddfff50c759 Mon Sep 17 00:00:00 2001 From: MattHag <16444067+MattHag@users.noreply.github.com> Date: Thu, 19 Sep 2024 00:36:33 +0200 Subject: [PATCH] Fix test coverage reporting Related #1097 --- .coveragerc | 20 ++++++++++++++++++++ .github/workflows/tests.yml | 2 +- Makefile | 2 +- 3 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 .coveragerc diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 00000000..f710d1bb --- /dev/null +++ b/.coveragerc @@ -0,0 +1,20 @@ +[run] +branch = True + +source = + hid_parser + hidapi + keysms + logitech_receiver + solaar + +omit = + */tests/* + */setup.py + */__main__.py + +[report] +exclude_lines = + pragma: no cover + if __name__ == '__main__': + if typing.TYPE_CHECKING diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a61726b8..42b7d799 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -55,4 +55,4 @@ jobs: make install_pip PIP_ARGS='.["test"]' - name: Run tests on macOS run: | - export DYLD_LIBRARY_PATH=$(brew --prefix hidapi)/lib:$DYLD_LIBRARY_PATH && pytest --cov=lib/ tests/ + export DYLD_LIBRARY_PATH=$(brew --prefix hidapi)/lib:$DYLD_LIBRARY_PATH && pytest --cov diff --git a/Makefile b/Makefile index 05261fc5..df51a880 100644 --- a/Makefile +++ b/Makefile @@ -66,4 +66,4 @@ lint: test: @echo "Running Solaar tests" - pytest --cov=lib/ tests/ + pytest --cov