How can I access the return value of a fixture defined via @pytest.mark.usefixtures #8816
Answered
by
RonnyPfannschmidt
FelixKJose
asked this question in
Q&A
-
I am not able to access the return value of a fixture when it is defined via @pytest.mark.usefixtures. Eg:
Following doesn't work:
worked. So you cannot use "@pytest.mark.usefixtures" to add fixtures for all tests in a Test class or module and access the defined fixtures return value in each test? |
Beta Was this translation helpful? Give feedback.
Answered by
RonnyPfannschmidt
Jun 29, 2021
Replies: 1 comment
-
if you want to use the value of a fixture, take it as a function argument pytest will not under any circumstance monkeypatch fixtures into other places |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
FelixKJose
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
if you want to use the value of a fixture, take it as a function argument
pytest will not under any circumstance monkeypatch fixtures into other places