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

Allow fixture scope to be customised #39

Open
markhobson opened this issue Dec 8, 2023 · 1 comment
Open

Allow fixture scope to be customised #39

markhobson opened this issue Dec 8, 2023 · 1 comment

Comments

@markhobson
Copy link

Some live servers support fixtures with a scope other than session, for example pytest-flask. When using a narrower scope with a custom base_url fixture, it is unable to be injected into the wider scoped _verify_url fixture:

ScopeMismatch: You tried to access the package scoped fixture base_url with a session scoped request object, involved factories:
.venv/lib/python3.12/site-packages/pytest_base_url/plugin.py:19:  def _verify_url(request, base_url)

Could the fixtures support dynamic scopes to resolve this?

@BeyondEvil
Copy link
Contributor

I'll welcome a PR that supports that!

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

No branches or pull requests

2 participants