Skip to content

Allow fixture scope to be customisedΒ #39

@markhobson

Description

@markhobson

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions