From e17a69ed8113e803a22e4292e5b898a25cf939dc Mon Sep 17 00:00:00 2001 From: InsanePrawn Date: Tue, 16 Aug 2022 18:20:06 +0200 Subject: [PATCH] add shellscript for running pytest, shellcheck *.sh --- .gitlab-ci.yml | 2 +- format.sh | 4 +--- pytest.sh | 4 ++++ 3 files changed, 6 insertions(+), 4 deletions(-) create mode 100755 pytest.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a126c52..9396106 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -29,7 +29,7 @@ pytest: - pacman -Sy --noconfirm --needed archlinux-keyring && pacman -Su --noconfirm python python-pip sudo git - pip install pytest -r requirements.txt script: - - script -e -c 'python -m pytest -v --junitxml=pytest-report.xml */test_*.py' + - script -e -c './pytest.sh' artifacts: reports: junit: pytest-report.xml diff --git a/format.sh b/format.sh index 1514aee..6860c4e 100755 --- a/format.sh +++ b/format.sh @@ -5,7 +5,7 @@ autoflake_args=('--recursive' '--remove-unused-variables' '--remove-all-unused-i format() { files=("$@") - if [[ -z "${files[@]}" ]]; then + if [[ -z "${files[*]}" ]]; then files=(".") fi @@ -14,8 +14,6 @@ format() { } - - if [[ "$1" == "--check" ]]; then yapf_args+=('--diff') shift diff --git a/pytest.sh b/pytest.sh new file mode 100755 index 0000000..f906f3c --- /dev/null +++ b/pytest.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +sudo -v +python -m pytest -v ./*/test_*.py