hypothesis: Fix or ignore deprecation warnings since version 5.6
Since version 5.6, hypothesis
warns on @given
+ function-scoped fixtures
(discussion about the legibility of that change here).
As a consequence a LOT of warnings are now issued when running swh-web
tests,
see https://jenkins.softwareheritage.org/job/DWAPPS/job/tests-on-diff/29/console
for instance.
So turns concerned swh-web
fixtures from function-scoped to module-scoped
(there is strictly no difference in tests execution result after that change)
and ignore some warnings related to external function-scoped fixtures that
are safe to use with @given
(client
from pytest-django
and mocker
from
pytest-mock
).
Migrated from D2933 (view on Phabricator)
Merge request reports
Activity
Build is green
Patch application report for D2933 (id=10420)
Rebasing onto fc6dc351...
Current branch diff-target is up to date.
Changes applied before test
commit 325e979556af4e9505e2d6327b29092dc64afd4d Author: Antoine Lambert <antoine.lambert@inria.fr> Date: Tue Mar 31 12:03:43 2020 +0200 hypothesis: Fix or ignore deprecation warnings since version 5.6 Since version 5.6, hypothesis warns on `@given` + function-scoped fixtures. So turns concerned swh-web fixtures from function-scoped to module-scoped (there is strictly no difference in tests execution result after that change) and ignore some warnings related to external function-scoped fixtures that are safe to use with @given (client from pytest-django and mocker from pytest-mock).
See https://jenkins.softwareheritage.org/job/DWAPPS/job/tests-on-diff/31/ for more details.
Build is green
Patch application report for D2933 (id=10423)
Rebasing onto 717159e4...
Current branch diff-target is up to date.
Changes applied before test
commit 91a0c4c8b0947b063391c8b2e6299fcb26bf3eb9 Author: Antoine Lambert <antoine.lambert@inria.fr> Date: Tue Mar 31 12:03:43 2020 +0200 hypothesis: Fix or ignore deprecation warnings since version 5.6 Since version 5.6, hypothesis warns on `@given` + function-scoped fixtures. So turns concerned swh-web fixtures from function-scoped to module-scoped (there is strictly no difference in tests execution result after that change) and ignore some warnings related to external function-scoped fixtures that are safe to use with @given (client from pytest-django and mocker from pytest-mock).
See https://jenkins.softwareheritage.org/job/DWAPPS/job/tests-on-diff/32/ for more details.
! In !279 (closed), @vlorentz wrote: These fixtures could even be session-scoped
Yes you're right, it also works with session-scoped and we gain 4 seconds on tests execution. I will update that diff.
Build is green
Patch application report for D2933 (id=10429)
Rebasing onto 717159e4...
Current branch diff-target is up to date.
Changes applied before test
commit f9172f8a395be545df50b14d755a332fbcfa3966 Author: Antoine Lambert <antoine.lambert@inria.fr> Date: Tue Mar 31 12:03:43 2020 +0200 hypothesis: Fix or ignore deprecation warnings since version 5.6 Since version 5.6, hypothesis warns on `@given` + function-scoped fixtures. So turns concerned swh-web fixtures from function-scoped to session-scoped (there is strictly no difference in tests execution result after that change) and ignore some warnings related to external function-scoped fixtures that are safe to use with @given (client from pytest-django and mocker from pytest-mock).
See https://jenkins.softwareheritage.org/job/DWAPPS/job/tests-on-diff/34/ for more details.