Skip to content
Snippets Groups Projects
Commit 8acd7263 authored by Antoine Lambert's avatar Antoine Lambert
Browse files

tests: Fix sampled_from hypothesis strategy import

It should be imported from hypothesis.strategies instead from the internal
private module.

This fixes Python tests when building debian buster package.
parent c7548f93
No related merge requests found
......@@ -4,8 +4,8 @@
# See top-level LICENSE file for more information
import attr
from hypothesis import given, strategies
from hypothesis.strategies._internal.core import sampled_from
from hypothesis import given
from hypothesis.strategies import composite, sampled_from, sets
import pytest
from swh.model.hypothesis_strategies import (
......@@ -20,7 +20,7 @@ from swh.web.tests.utils import check_api_get_responses, check_http_get_response
# public Web API endpoint for raw extrinsic metadata does not support
# extended SWHIDs so we ensure only core ones will be used in test inputs.
@strategies.composite
@composite
def raw_extrinsic_metadata(draw):
remd = draw(raw_extrinsic_metadata_orig())
remd = attr.evolve(
......@@ -73,7 +73,7 @@ def test_api_raw_extrinsic_metadata(api_client, subtest, metadata):
@pytest.mark.parametrize("limit", [1, 2, 10, 100])
@given(strategies.sets(raw_extrinsic_metadata(), min_size=1))
@given(sets(raw_extrinsic_metadata(), min_size=1))
def test_api_raw_extrinsic_metadata_scroll(api_client, subtest, limit, meta):
# ensure archive_data fixture will be reset between each hypothesis
# example test run
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment