Files
poky/bitbake/lib/toaster/pytest.ini
Alexander Lussier-Cullen 637fdcc2b1 bitbake: toaster: fix pytest build test execution and test discovery
Ensure the proper django settings are used by moving the variable to
the environment assignment.
Remove python file specifier as this works relative to the working
directory, which can vary. The test file directory can instead be
specified when executing the pytest command.
Add annotations required to allow database access with pytest to the
build tests.

(Bitbake rev: 7f4dfaa5bd28ccf1ae0122d984ffa7e02e693960)

Signed-off-by: Alexander Lussier-Cullen <alexander.lussier-cullen@savoirfairelinux.com>
CC: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-06 22:37:03 +00:00

17 lines
761 B
INI

# -- FILE: pytest.ini (or tox.ini)
[pytest]
# --create-db - force re creation of the test database
# https://pytest-django.readthedocs.io/en/latest/database.html#create-db-force-re-creation-of-the-test-database
# --html=report.html --self-contained-html
# https://docs.pytest.org/en/latest/usage.html#creating-html-reports
# https://pytest-html.readthedocs.io/en/latest/user_guide.html#creating-a-self-contained-report
addopts = --create-db --html="Toaster Tests Report.html" --self-contained-html
# Define environment variables using pytest-env
# A pytest plugin that enables you to set environment variables in the pytest.ini file.
# https://pypi.org/project/pytest-env/
env =
TOASTER_BUILDSERVER=1
DJANGO_SETTINGS_MODULE=toastermain.settings_test