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

ScopeMismatch on faker_seed with Faker v32.0.0 #656

Open
GertBurger opened this issue Nov 13, 2024 · 1 comment
Open

ScopeMismatch on faker_seed with Faker v32.0.0 #656

GertBurger opened this issue Nov 13, 2024 · 1 comment

Comments

@GertBurger
Copy link

GertBurger commented Nov 13, 2024

Python Version

3.9.18

pytest Version

8.3.3

Package Version

3.15.0

Description

Since Faker v32.0.0 its faker fixture has been scoped to session which triggers this error in relation to faker_seed:

Failed: ScopeMismatch: You tried to access the function scoped fixture faker_seed with a session scoped request object. Requesting fixture stack:
../root/build_env3/lib/python3.9/site-packages/faker/contrib/pytest/plugin.py:23:  def faker(request)
Requested fixture:
../root/build_env3/lib/python3.9/site-packages/pytest_randomly/__init__.py:301:  def faker_seed(pytestconfig: 'Config') -> 'int'

joke2k/faker#2117
joke2k/faker#2055

browniebroke added a commit to browniebroke/pytest-randomly that referenced this issue Nov 14, 2024
Faker has changed its main fixture to be session scoped in v32 and uses faker_seed, so this needs to match.

Fix pytest-dev#656
@fcurella
Copy link

fcurella commented Nov 14, 2024

I've reverted Faker's change in v33.0.0

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

Successfully merging a pull request may close this issue.

2 participants