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
Our pytest plugin loads all Hypothesis entry points, which may have undesirable side effects #3140
Comments
Thanks for the report! The weird thing here is that we've already designed Hypothesis to avoid creating the I think this could happen because you have some package (e.g. Pydantic) with a Hypothesis entry point installed (e.g. Pydantic), and then when The only problem is that this doesn't fit at all with your bisection! I am seriously confused. |
Aha, it is pydantic! Uninstalling pydantic prevents it from happening, re-installing pydantic reproduces it. (Before this, I uninstalled all |
Looks like we might need to refactor our pytest plugin for lazy-loading of Hypothesis then... it'll be a little annoying, but could be worse! |
Confirmed fixed with hypothesis-6.28.0, pytest-6.2.5 and pydantic-1.8.2: $ l
total 0
drwxr-xr-x 2 hugo wheel 64B 28 Nov 15:52 .
drwxrwxrwt 57 root wheel 1.8K 28 Nov 15:52 ..
$ pytest
========================================================= test session starts =========================================================
platform darwin -- Python 3.10.0, pytest-6.2.5, py-1.10.0, pluggy-1.0.0
rootdir: /private/tmp/123
plugins: respx-0.19.0, freezegun-0.4.2, hypothesis-6.28.0, flaky-3.7.0, xdist-2.4.0, timeout-2.0.1, anyio-3.3.4, forked-1.3.0, cov-3.0.0
collected 0 items
======================================================== no tests ran in 0.03s ========================================================
$ l
total 0
drwxr-xr-x 3 hugo wheel 96B 28 Nov 15:52 .
drwxrwxrwt 57 root wheel 1.8K 28 Nov 15:52 ..
drwxr-xr-x 6 hugo wheel 192B 28 Nov 15:52 .pytest_cache Thanks! |
If I have Hypothesis installed and run pytest, it always creates
.hypothesis/unicode_data/13.0.0/charmap.json.gz
, whether the project uses Hypothesis or not.This then shows up as an untracked file, because the non-Hypotheis project has no reason to put
.hypothesis
in.gitignore
.Would it be feasible to avoid creating the file, or creating it in a non-local directory?
Alternative
If this is non-trivial, I can easily enough put
.hypothesis
in a global.gitignore
file.Minimal demo
Python 3.10
pytest
hypothesis 6.24.2
Running pytest in an empty directory without hypothesis installed:
Installing hypothesis and running pytest:
Bisecting
Bisecting releases, this didn't happen with 5.48.0 and started in 5.49.0.
Bisecting commits, this started in 763e545 from PR #2738.
(Due to the frequency of Hypothesis releases, it was really easy to bisect this!)
Thank you!
The text was updated successfully, but these errors were encountered: