Merge pull request #2595 from jreidinger/pytest

use pytest instead of nosetests
This commit is contained in:
Stephan Kulow 2021-07-13 14:00:59 +02:00 committed by GitHub
commit 677b31630a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 6 deletions

View File

@ -15,10 +15,13 @@ done
cd /code
for file in tests/*_tests.py; do
if ! test -f /code/.without-coverage; then
COVER_ARGS="--with-coverage --cover-xml --cover-package=. --cover-inclusive"
COVER_ARGS="--cov=. --cov-append --cov-report=xml"
else
COVER_ARGS="--no-cov"
fi
echo "running tests from $file..."
run_as_tester nosetests $COVER_ARGS -c .noserc -s $file
# TODO: Review bot test failed without log-level set to debug
# TODO: due to memoize tests cannot be run together, otherwise it start failing
run_as_tester pytest $COVER_ARGS --log-level=DEBUG $file
done
set -x

View File

@ -5,9 +5,9 @@ FROM opensuse/tumbleweed
RUN zypper -n ar http://download.opensuse.org/repositories/openSUSE:/Tools/openSUSE_Factory/ openSUSE:Tools
RUN zypper --gpg-auto-import-keys ref
RUN zypper in -y osc python3-pytest python3-nose python3-httpretty python3-pyxdg python3-PyYAML \
RUN zypper in -y osc python3-pytest python3-httpretty python3-pyxdg python3-PyYAML \
python3-pika python3-mock python3-cmdln python3-lxml python3-python-dateutil python3-colorama \
python3-influxdb python3-coverage python3-pytest-cov python3-coveralls libxml2-tools curl python3-flake8 \
python3-influxdb python3-pytest-cov python3-coveralls libxml2-tools curl python3-flake8 \
shadow vim vim-data strace git sudo patch openSUSE-release openSUSE-release-ftp \
perl-Net-SSLeay perl-Text-Diff perl-XML-Simple perl-XML-Parser build \
obs-service-download_files

View File

@ -21,7 +21,7 @@ from check_tags_in_requests import TagChecker
sys.path.append(".")
APIURL = 'http://maintenancetest.example.com'
FIXTURES = os.path.join(os.getcwd(), 'tests/fixtures')
FIXTURES = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'fixtures')
class TestTagChecker(unittest.TestCase):