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

Only works with function scoped fixture #15

Open
parisni opened this issue Apr 28, 2021 · 1 comment
Open

Only works with function scoped fixture #15

parisni opened this issue Apr 28, 2021 · 1 comment

Comments

@parisni
Copy link

parisni commented Apr 28, 2021

this does not work apparently:

@pytest.fixture(scope="session")
def test_foo(resource_path_root):
     pass
ScopeMismatch: You tried to access the 'function' scoped fixture 'resource_path_root' with a 'session' scoped request object, involved factories
@yukihiko-shinoda
Copy link
Owner

yukihiko-shinoda commented May 1, 2021

I deployed 1.3.0 which supports package scope or less.
However, it currently doesn't support session scope.
Even if it will support session scope in future, implementation will be required quite different.
Since this plugin detects resource path by going upstream of file path from path to test file.
In session scope, path to test file is not present.
It requires quite different discovery algorithm
and it may expect several patterns depending on project structure and execution directory.

cf.

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