From d12a3bbf7055d59e737d5b99f1afa848dba6ad42 Mon Sep 17 00:00:00 2001
From: Mikolaj Izdebski <mizdebsk@redhat.com>
Date: Tue, 14 Jun 2022 18:56:47 +0200
Subject: [PATCH 2/2] Allow running check without coverage
---
check | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/check b/check
index 16e005a9..2305307d 100755
--- a/check
+++ b/check
@@ -47,8 +47,11 @@ if [ -z "$pyinterpreter" ]; then
exit 0
fi
+cov_config=--cov-config=../.coveragerc
+
if ! coverage --version >/dev/null 2>&1; then
coverage(){ :;}
+ cov_config=
fi
cat >.coveragerc <<EOF
@@ -65,9 +68,9 @@ export COVERAGE_PROCESS_START="${PWD}/.coveragerc"
export PYTHONPATH="${PWD}/test/coverage${PYTHONPATH:+:}${PYTHONPATH:-}"
echo "Running Python tests with ${pyinterpreter}..."
-(cd ./python && "${pyinterpreter}" -m pytest -v --cov-config=../.coveragerc)
+(cd ./python && "${pyinterpreter}" -m pytest -v ${cov_config})
r1=$?
-(cd ./test && PYTHONPATH="${PWD}/../python${PYTHONPATH:+:}${PYTHONPATH:-}" "${pyinterpreter}" -m pytest -v --cov-config=../.coveragerc)
+(cd ./test && PYTHONPATH="${PWD}/../python${PYTHONPATH:+:}${PYTHONPATH:-}" "${pyinterpreter}" -m pytest -v ${cov_config})
r2=$?
if [ ${r1} -lt ${r2} ]; then
--
2.35.3