-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Closed
Labels
status: needs informationreporter needs to provide more information; can be closed after 2 or more weeks of inactivityreporter needs to provide more information; can be closed after 2 or more weeks of inactivitytype: questiongeneral question, might be closed after 2 weeks of inactivitygeneral question, might be closed after 2 weeks of inactivity
Description
Hey, guys. So I have this scenario where I would really appreciate some help.
Here is a mock example:
├──parent
│ ├──test1dir
│ │ ├ conftest.py
│ │ ├ test_1.py
│ ├ conftest.py
# parent/test1dir/conftest.py
def pytest_runtest_setup(item):
do_something(item, local_fixt())
# --> somehow set global_var in parent conftest <--
@pytest.fixture(scope="session")
def local_fixt():
return 123
# parent/test1dir/conftest.py
@pytest.fixture(scope="session") # same for function scoped fixtures
def session_fixt(local_fixt)
do_something(global_var)
do_something(local_fixt)
Reason why I don't move pytest_runtest_setup in parent conftest is that I need it to access local_fixt() and it isn't able to do that from the upper conftest file as it would solve this issue.
Metadata
Metadata
Assignees
Labels
status: needs informationreporter needs to provide more information; can be closed after 2 or more weeks of inactivityreporter needs to provide more information; can be closed after 2 or more weeks of inactivitytype: questiongeneral question, might be closed after 2 weeks of inactivitygeneral question, might be closed after 2 weeks of inactivity