From 45b63467c308a071101341303c1a5e9500dde617 Mon Sep 17 00:00:00 2001 From: CoolCat467 <52022020+CoolCat467@users.noreply.github.com> Date: Fri, 4 Oct 2024 20:46:29 -0500 Subject: [PATCH] Try to fix coverage and fix tests badge --- README.md | 2 +- ci.sh | 2 +- pyproject.toml | 2 +- tests/test_import.py | 6 ++++++ 4 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 tests/test_import.py diff --git a/README.md b/README.md index f70764b..64368d1 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Scanner-Server Kind of like CUPS but it's for scanning, not printing. -[![Tests](https://github.com/CoolCat467/Scanner-Server/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/CoolCat467/Scanner-Server/actions/workflows/tests.yml) +[![Tests](https://github.com/CoolCat467/Scanner-Server/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/CoolCat467/Scanner-Server/actions/workflows/ci.yml) [![pre-commit.ci status](https://results.pre-commit.ci/badge/github/CoolCat467/Scanner-Server/main.svg)](https://results.pre-commit.ci/latest/github/CoolCat467/Scanner-Server/main) diff --git a/ci.sh b/ci.sh index 51d394e..8ce83f1 100755 --- a/ci.sh +++ b/ci.sh @@ -68,7 +68,7 @@ else echo "::endgroup::" echo "::group:: Run Tests" - if COVERAGE_PROCESS_START=$(pwd)/../pyproject.toml coverage run --rcfile=../pyproject.toml -m pytest -ra --junitxml=../test-results.xml "$(pwd)/../tests" --verbose --durations=10 $flags; then + if coverage run --rcfile=../pyproject.toml -m pytest -ra --junitxml=../test-results.xml "$(pwd)/../tests" --verbose --durations=10 $flags; then PASSED=true else PASSED=false diff --git a/pyproject.toml b/pyproject.toml index 873f7a9..d77d7a4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -143,7 +143,7 @@ extend-ignore = [ ] [tool.pytest.ini_options] -addopts = "--cov-report term-missing --cov=sanescansrv" +addopts = "--cov=sanescansrv --cov-report=xml --cov-report=term-missing" testpaths = [ "tests", ] diff --git a/tests/test_import.py b/tests/test_import.py new file mode 100644 index 0000000..3957bca --- /dev/null +++ b/tests/test_import.py @@ -0,0 +1,6 @@ +import sanescansrv + + +def test_has_run() -> None: + assert hasattr(sanescansrv, "run") + assert callable(sanescansrv.run)