diff --git a/swh/storage/tests/algos/test_snapshot.py b/swh/storage/tests/algos/test_snapshot.py --- a/swh/storage/tests/algos/test_snapshot.py +++ b/swh/storage/tests/algos/test_snapshot.py @@ -3,7 +3,7 @@ # License: GNU General Public License version 3, or any later version # See top-level LICENSE file for more information -from hypothesis import given +from hypothesis import HealthCheck, given, settings import pytest from swh.model.hypothesis_strategies import branch_names, branch_targets, snapshots @@ -32,6 +32,7 @@ } +@settings(suppress_health_check=[HealthCheck.function_scoped_fixture]) @given(snapshot=snapshots(min_size=0, max_size=10, only_objects=False)) def test_snapshot_small(swh_storage, snapshot): # noqa swh_storage.snapshot_add([snapshot]) @@ -40,6 +41,7 @@ assert snapshot == returned_snapshot +@settings(suppress_health_check=[HealthCheck.function_scoped_fixture]) @given(branch_name=branch_names(), branch_target=branch_targets(only_objects=True)) def test_snapshot_large(swh_storage, branch_name, branch_target): # noqa snapshot = Snapshot( diff --git a/swh/storage/tests/storage_tests.py b/swh/storage/tests/storage_tests.py --- a/swh/storage/tests/storage_tests.py +++ b/swh/storage/tests/storage_tests.py @@ -420,7 +420,10 @@ assert missing == [cont2.hashes()] @pytest.mark.property_based - @settings(deadline=None) # this test is very slow + @settings( + deadline=None, # this test is very slow + suppress_health_check=[HealthCheck.function_scoped_fixture], + ) @given( strategies.sets( elements=strategies.sampled_from(["sha256", "sha1_git", "blake2s256"]), @@ -451,6 +454,7 @@ ) == set(missing_per_hash[hash]) @pytest.mark.property_based + @settings(suppress_health_check=[HealthCheck.function_scoped_fixture]) @given( strategies.sets( elements=strategies.sampled_from(["sha256", "sha1_git", "blake2s256"]), @@ -3920,7 +3924,12 @@ ) assert swh_storage.origin_count("github", regexp=True, with_visit=True) == 1 - @settings(suppress_health_check=[HealthCheck.too_slow]) + @settings( + suppress_health_check=[ + HealthCheck.too_slow, + HealthCheck.function_scoped_fixture, + ] + ) @given(strategies.lists(objects(split_content=True), max_size=2)) def test_add_arbitrary(self, swh_storage, objects): for (obj_type, obj) in objects: