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

pytest-redis errors with pytest 7.0.0 #349

Closed
cfal opened this issue Dec 8, 2021 · 2 comments
Closed

pytest-redis errors with pytest 7.0.0 #349

cfal opened this issue Dec 8, 2021 · 2 comments

Comments

@cfal
Copy link
Contributor

cfal commented Dec 8, 2021

after updating my pipenv, I noticed that pytest-redis (and also pytest-postgres) both raises on import due to:

ImportError: cannot import name 'TempdirFactory' from '_pytest.tmpdir'

the setup.cfg of pytest-redis doesn't have any version constraints, while pytest-postgresql's has >= 3.0.0.

pytest changelog notes that importing TempdirFactory directly is now deprecated, and could become a hard error in 7.0.0: https://docs.pytest.org/en/stable/changelog.html#deprecations

@needs
Copy link

needs commented Feb 8, 2022

This issue can be temporarily fixed by downgrading pytest to the latest version before 7.0.0:

pytest==6.2.5

Now that pytest 7.0.0 is out, pytest-redis simply prevent pytest from starting.

@fizyk
Copy link
Member

fizyk commented Feb 9, 2022

the tmpdir_factory fixture with tmp_path_factory fixture.

The minimum supported pytest version should then be set to 6.2
ref: ClearcodeHQ/pytest-postgresql#533

@fizyk fizyk closed this as completed in 85fe76c Feb 10, 2022
fizyk added a commit that referenced this issue Feb 10, 2022
Change typing imports, require pytest 6.2 minimum - closes #349
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants