Select specific set of fixtures conditionally #10367
Unanswered
f00dog-x300
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Currently there is no built-in mechanism, the recommended way to dynamically add plugins is to use the pytest_configure hook and registering plugins to the pluginmanager |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all, I hope the title makes sense. Essentially I was looking for a way to conditionally use a set of fixtures from a specific directory.
This is essentially how the project is laid out:
src
|
|_ ios
|
|_android
|
|_conftest.py
On my conftest.py file in the root of the project, I have something that looks like:
pytest_plugins = [
"pages.ios.pages.login_page_fixtures",
"pages.ios.pages.status_page_fixtures",
]
I have similarly named test fixtures on both ios and android packages directories, however if I run an iOS test , I want to make sure that I only use the iOS test fixtures. However, later on I will need to use the android fixtures as part of the project. Since the fixtures are similarly named, I was wondering if there was a way to conditionally select the fixtures from ios vs android.
Beta Was this translation helpful? Give feedback.
All reactions