Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Register pytest plugin instead of generating conftest.py #297

Open
brandon-leapyear opened this issue Jan 10, 2023 · 2 comments
Open

Register pytest plugin instead of generating conftest.py #297

brandon-leapyear opened this issue Jan 10, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@brandon-leapyear
Copy link

I'm trying to integrate Pylenium into an existing Pytest suite, and I don't want to copy the Pylenium conftest.py into our manually written conftest.py. But also in general, registering a Pytest plugin is much more idiomatic than generating a conftest.py file.

Currently working around this by renaming the file to pylenium_conftest.py and adding pytest_plugins = ["pylenium_conftest"] in conftest.py

@ElSnoMan
Copy link
Owner

We made this decision early on because users would change a lot of things within the Pylenium fixtures to fit their context. Obviously, we've made a lot of changes and optimizations to those fixtures since then, so it might be time to finally register it.

@ElSnoMan ElSnoMan added the enhancement New feature or request label Jan 10, 2023
@ElSnoMan
Copy link
Owner

ElSnoMan commented Jun 17, 2023

PRs are welcome! I'll be adding this in v1.18.x or later. Here are some docs to help get started:

And since we use Poetry, we should be able to add the plugin in pyproject.toml. Something like this:

[tool.poetry.plugins]
pytest11 = { pylenium = "pylenium.scripts.conftest" }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants