e2e_tests/recipes/demo/tests_demo/fixtures_demo.py
Daniel 8685688698 installable package (#9)
* turn repo into installable package (pip install -e .)

* add hatchling build packend

* call it pytest-abra

* add pytest entrypoint, so that it gets loaded automatically if installed (and pytest is run)

* make fixtures optional, so that pytest can still be used in other context

* add cli script -> you can now directly run "pytest-abra" in console

Reviewed-on: local-it-infrastructure/e2e_tests#9
Co-authored-by: Daniel <d.brummerloh@gmail.com>
Co-committed-by: Daniel <d.brummerloh@gmail.com>
2023-12-07 11:32:01 +01:00

26 lines
713 B
Python

"""
This file can be used to define fixtures thate are then used by other tests which
depend on [demo]. For this to work
1. the Runner class of the other test needs to define the depencency as seen
by referencing RunnerDemo in the dependencies list:
from pytest_abra.tests_demo.runner_demo import RunnerDemo
class RunnerOther(Runner):
dependencies = [RunnerDemo]
2. the specific tests that rely on these fixtures need to import the fixtures.
To globally import for all tests in 'other', the import should be done in conftest:
in 'conftest.py' in 'test_other' dir:
from pytest_abra.tests_demo.fixtures_demo import demo_fixture
"""
import pytest
@pytest.fixture
def demo_fixture():
return ""