Replies: 2 comments 5 replies
-
if you create the client connection at pytest_configure time, you can use it in both generate_tests and the fixture later on |
Beta Was this translation helpful? Give feedback.
5 replies
-
Yeah I think so, good idea. Created #8208 to track this. 👍 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I have a situation I don't know how to tackle.
For simplicity, let's assume I'm testing a server. This server has a dynamic list of "supported client versions". I want to run a test that would look like this:
and to get as many test runs as there are versions.
Connection to the server is done in a session-scoped fixture, and try as I might, I couldn't use pytest_generate_tests since metafunc does not have access to fixture values (or at least, I couldn't find one, assuming fixtures are calculated after the collection phase).
I need the requests to the server run only if "group_a" is selected, so replicating the logic in the server connection fixture is not helpful.
Is there a way to do that in pytest? generating a test from a fixture or from another test?
Beta Was this translation helpful? Give feedback.
All reactions