self = <hypothesis.core.StateForActualGivenExecution object at 0x7fdb324686a0>
data = ConjectureData(INTERESTING, 32 bytes, frozen)
def _execute_once_for_engine(self, data):
"""Wrapper around ``execute_once`` that intercepts test failure
exceptions and single-test control exceptions, and turns them into
appropriate method calls to `data` instead.
This allows the engine to assume that any exception other than
``StopTest`` must be a fatal error, and should stop the entire engine.
"""
try:
> result = self.execute_once(data)
.tox/py3/lib/python3.7/site-packages/hypothesis/core.py:674:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <hypothesis.core.StateForActualGivenExecution object at 0x7fdb324686a0>
data = ConjectureData(INTERESTING, 32 bytes, frozen), print_example = False
is_final = False, expected_failure = None
def execute_once(
self, data, print_example=False, is_final=False, expected_failure=None
):
"""Run the test function once, using ``data`` as input.
If the test raises an exception, it will propagate through to the
caller of this method. Depending on its type, this could represent
an ordinary test failure, or a fatal error, or a control exception.
If this method returns normally, the test might have passed, or
it might have placed ``data`` in an unsuccessful state and then
swallowed the corresponding control exception.
"""
data.is_find = self.is_find
text_repr = [None]
if self.settings.deadline is None:
test = self.test
else:
@proxies(self.test)
def test(*args, **kwargs):
self.__test_runtime = None
initial_draws = len(data.draw_times)
start = time.perf_counter()
result = self.test(*args, **kwargs)
finish = time.perf_counter()
internal_draw_time = sum(data.draw_times[initial_draws:])
runtime = datetime.timedelta(
seconds=finish - start - internal_draw_time
)
self.__test_runtime = runtime
current_deadline = self.settings.deadline
if not is_final:
current_deadline = (current_deadline // 4) * 5
if runtime >= current_deadline:
raise DeadlineExceeded(runtime, self.settings.deadline)
return result
def run(data):
# Set up dynamic context needed by a single test run.
with local_settings(self.settings):
with deterministic_PRNG():
with BuildContext(data, is_final=is_final):
# Generate all arguments to the test function.
args, kwargs = data.draw(self.search_strategy)
if expected_failure is not None:
text_repr[0] = arg_string(test, args, kwargs)
if print_example or current_verbosity() >= Verbosity.verbose:
output = StringIO()
printer = RepresentationPrinter(output)
if print_example:
printer.text("Falsifying example:")
else:
printer.text("Trying example:")
if self.print_given_args:
printer.text(" ")
printer.text(test.__name__)
with printer.group(indent=4, open="(", close=""):
printer.break_()
for v in args:
printer.pretty(v)
# We add a comma unconditionally because
# generated arguments will always be
# kwargs, so there will always be more
# to come.
printer.text(",")
printer.breakable()
# We need to make sure to print these in the
# argument order for Python 2 and older versions
# of Python 3.5. In modern versions this isn't
# an issue because kwargs is ordered.
arg_order = {
v: i
for i, v in enumerate(
getfullargspec(self.test).args
)
}
for i, (k, v) in enumerate(
sorted(
kwargs.items(),
key=lambda t: (
arg_order.get(t[0], float("inf")),
t[0],
),
)
):
printer.text(k)
printer.text("=")
printer.pretty(v)
printer.text(",")
if i + 1 < len(kwargs):
printer.breakable()
printer.break_()
printer.text(")")
printer.flush()
report(output.getvalue())
return test(*args, **kwargs)
# Run the test function once, via the executor hook.
# In most cases this will delegate straight to `run(data)`.
> result = self.test_runner(data, run)
.tox/py3/lib/python3.7/site-packages/hypothesis/core.py:629:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
data = ConjectureData(INTERESTING, 32 bytes, frozen)
function = <function StateForActualGivenExecution.execute_once.<locals>.run at 0x7fdb313479d8>
def default_new_style_executor(data, function):
> return function(data)
.tox/py3/lib/python3.7/site-packages/hypothesis/executors.py:52:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
data = ConjectureData(INTERESTING, 32 bytes, frozen)
def run(data):
# Set up dynamic context needed by a single test run.
with local_settings(self.settings):
with deterministic_PRNG():
with BuildContext(data, is_final=is_final):
# Generate all arguments to the test function.
> args, kwargs = data.draw(self.search_strategy)
.tox/py3/lib/python3.7/site-packages/hypothesis/core.py:569:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = ConjectureData(INTERESTING, 32 bytes, frozen)
strategy = TupleStrategy((just(()), fixed_dictionaries({'unknown_content': new_content().filter(lambda c: get_tests_data()["stora...mbda s: get_tests_data()["storage"].snapshot_get_branches(hash_to_bytes(s)))}).map(lambda args: dict(args, **kwargs))))
label = 9447048757421901795
def draw(self, strategy, label=None):
if self.is_find and not strategy.supports_find:
raise InvalidArgument(
(
"Cannot use strategy %r within a call to find (presumably "
"because it would be invalid after the call had ended)."
)
% (strategy,)
)
at_top_level = self.depth == 0
if at_top_level:
# We start this timer early, because accessing attributes on a LazyStrategy
# can be almost arbitrarily slow. In cases like characters() and text()
# where we cache something expensive, this led to Flaky deadline errors!
# See https://github.com/HypothesisWorks/hypothesis/issues/2108
start_time = time.perf_counter()
strategy.validate()
if strategy.is_empty:
self.mark_invalid()
if self.depth >= MAX_DEPTH:
self.mark_invalid()
if label is None:
label = strategy.label
self.start_example(label=label)
try:
if not at_top_level:
return strategy.do_draw(self)
else:
strategy.validate()
try:
> return strategy.do_draw(self)
.tox/py3/lib/python3.7/site-packages/hypothesis/internal/conjecture/data.py:887:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = TupleStrategy((just(()), fixed_dictionaries({'unknown_content': new_content().filter(lambda c: get_tests_data()["stora...mbda s: get_tests_data()["storage"].snapshot_get_branches(hash_to_bytes(s)))}).map(lambda args: dict(args, **kwargs))))
data = ConjectureData(INTERESTING, 32 bytes, frozen)
def do_draw(self, data):
> return tuple(data.draw(e) for e in self.element_strategies)
.tox/py3/lib/python3.7/site-packages/hypothesis/strategies/_internal/collections.py:57:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.0 = <tuple_iterator object at 0x7fdb3245be80>
> return tuple(data.draw(e) for e in self.element_strategies)
.tox/py3/lib/python3.7/site-packages/hypothesis/strategies/_internal/collections.py:57:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = ConjectureData(INTERESTING, 32 bytes, frozen)
strategy = fixed_dictionaries({'unknown_content': new_content().filter(lambda c: get_tests_data()["storage"].content_get_data(has...lambda s: get_tests_data()["storage"].snapshot_get_branches(hash_to_bytes(s)))}).map(lambda args: dict(args, **kwargs))
label = 10700208128082112041
def draw(self, strategy, label=None):
if self.is_find and not strategy.supports_find:
raise InvalidArgument(
(
"Cannot use strategy %r within a call to find (presumably "
"because it would be invalid after the call had ended)."
)
% (strategy,)
)
at_top_level = self.depth == 0
if at_top_level:
# We start this timer early, because accessing attributes on a LazyStrategy
# can be almost arbitrarily slow. In cases like characters() and text()
# where we cache something expensive, this led to Flaky deadline errors!
# See https://github.com/HypothesisWorks/hypothesis/issues/2108
start_time = time.perf_counter()
strategy.validate()
if strategy.is_empty:
self.mark_invalid()
if self.depth >= MAX_DEPTH:
self.mark_invalid()
if label is None:
label = strategy.label
self.start_example(label=label)
try:
if not at_top_level:
> return strategy.do_draw(self)
.tox/py3/lib/python3.7/site-packages/hypothesis/internal/conjecture/data.py:883:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = fixed_dictionaries({'unknown_content': new_content().filter(lambda c: get_tests_data()["storage"].content_get_data(has...lambda s: get_tests_data()["storage"].snapshot_get_branches(hash_to_bytes(s)))}).map(lambda args: dict(args, **kwargs))
data = ConjectureData(INTERESTING, 32 bytes, frozen)
def do_draw(self, data: ConjectureData) -> Ex:
for _ in range(3):
i = data.index
try:
data.start_example(MAPPED_SEARCH_STRATEGY_DO_DRAW_LABEL)
> result = self.pack(data.draw(self.mapped_strategy))
.tox/py3/lib/python3.7/site-packages/hypothesis/strategies/_internal/strategies.py:650:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = ConjectureData(INTERESTING, 32 bytes, frozen)
strategy = fixed_dictionaries({'unknown_content': new_content().filter(lambda c: get_tests_data()["storage"].content_get_data(has...lter_checksum).map(hash_to_hex).filter(lambda s: get_tests_data()["storage"].snapshot_get_branches(hash_to_bytes(s)))})
label = 12000696373305623442
def draw(self, strategy, label=None):
if self.is_find and not strategy.supports_find:
raise InvalidArgument(
(
"Cannot use strategy %r within a call to find (presumably "
"because it would be invalid after the call had ended)."
)
% (strategy,)
)
at_top_level = self.depth == 0
if at_top_level:
# We start this timer early, because accessing attributes on a LazyStrategy
# can be almost arbitrarily slow. In cases like characters() and text()
# where we cache something expensive, this led to Flaky deadline errors!
# See https://github.com/HypothesisWorks/hypothesis/issues/2108
start_time = time.perf_counter()
strategy.validate()
if strategy.is_empty:
self.mark_invalid()
if self.depth >= MAX_DEPTH:
self.mark_invalid()
if label is None:
label = strategy.label
self.start_example(label=label)
try:
if not at_top_level:
> return strategy.do_draw(self)
.tox/py3/lib/python3.7/site-packages/hypothesis/internal/conjecture/data.py:883:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = fixed_dictionaries({'unknown_content': new_content().filter(lambda c: get_tests_data()["storage"].content_get_data(has...lter_checksum).map(hash_to_hex).filter(lambda s: get_tests_data()["storage"].snapshot_get_branches(hash_to_bytes(s)))})
data = ConjectureData(INTERESTING, 32 bytes, frozen)
def do_draw(self, data):
> return data.draw(self.wrapped_strategy)
.tox/py3/lib/python3.7/site-packages/hypothesis/strategies/_internal/lazy.py:150:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = ConjectureData(INTERESTING, 32 bytes, frozen)
strategy = FixedKeysDictStrategy(('unknown_content', 'unknown_directory', 'unknown_release', 'unknown_revision', 'unknown_snapsho...ter_checksum).map(hash_to_hex).filter(lambda s: get_tests_data()["storage"].snapshot_get_branches(hash_to_bytes(s))))))
label = 12000696373305623442
def draw(self, strategy, label=None):
if self.is_find and not strategy.supports_find:
raise InvalidArgument(
(
"Cannot use strategy %r within a call to find (presumably "
"because it would be invalid after the call had ended)."
)
% (strategy,)
)
at_top_level = self.depth == 0
if at_top_level:
# We start this timer early, because accessing attributes on a LazyStrategy
# can be almost arbitrarily slow. In cases like characters() and text()
# where we cache something expensive, this led to Flaky deadline errors!
# See https://github.com/HypothesisWorks/hypothesis/issues/2108
start_time = time.perf_counter()
strategy.validate()
if strategy.is_empty:
self.mark_invalid()
if self.depth >= MAX_DEPTH:
self.mark_invalid()
if label is None:
label = strategy.label
self.start_example(label=label)
try:
if not at_top_level:
> return strategy.do_draw(self)
.tox/py3/lib/python3.7/site-packages/hypothesis/internal/conjecture/data.py:883:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = FixedKeysDictStrategy(('unknown_content', 'unknown_directory', 'unknown_release', 'unknown_revision', 'unknown_snapsho...ter_checksum).map(hash_to_hex).filter(lambda s: get_tests_data()["storage"].snapshot_get_branches(hash_to_bytes(s))))))
data = ConjectureData(INTERESTING, 32 bytes, frozen)
def do_draw(self, data: ConjectureData) -> Ex:
for _ in range(3):
i = data.index
try:
data.start_example(MAPPED_SEARCH_STRATEGY_DO_DRAW_LABEL)
> result = self.pack(data.draw(self.mapped_strategy))
.tox/py3/lib/python3.7/site-packages/hypothesis/strategies/_internal/strategies.py:650:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = ConjectureData(INTERESTING, 32 bytes, frozen)
strategy = TupleStrategy((new_content().filter(lambda c: get_tests_data()["storage"].content_get_data(hash_to_bytes(c["sha1"]))),...lter_checksum).map(hash_to_hex).filter(lambda s: get_tests_data()["storage"].snapshot_get_branches(hash_to_bytes(s)))))
label = 293202300593257990
def draw(self, strategy, label=None):
if self.is_find and not strategy.supports_find:
raise InvalidArgument(
(
"Cannot use strategy %r within a call to find (presumably "
"because it would be invalid after the call had ended)."
)
% (strategy,)
)
at_top_level = self.depth == 0
if at_top_level:
# We start this timer early, because accessing attributes on a LazyStrategy
# can be almost arbitrarily slow. In cases like characters() and text()
# where we cache something expensive, this led to Flaky deadline errors!
# See https://github.com/HypothesisWorks/hypothesis/issues/2108
start_time = time.perf_counter()
strategy.validate()
if strategy.is_empty:
self.mark_invalid()
if self.depth >= MAX_DEPTH:
self.mark_invalid()
if label is None:
label = strategy.label
self.start_example(label=label)
try:
if not at_top_level:
> return strategy.do_draw(self)
.tox/py3/lib/python3.7/site-packages/hypothesis/internal/conjecture/data.py:883:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = TupleStrategy((new_content().filter(lambda c: get_tests_data()["storage"].content_get_data(hash_to_bytes(c["sha1"]))),...lter_checksum).map(hash_to_hex).filter(lambda s: get_tests_data()["storage"].snapshot_get_branches(hash_to_bytes(s)))))
data = ConjectureData(INTERESTING, 32 bytes, frozen)
def do_draw(self, data):
> return tuple(data.draw(e) for e in self.element_strategies)
.tox/py3/lib/python3.7/site-packages/hypothesis/strategies/_internal/collections.py:57:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.0 = <tuple_iterator object at 0x7fdb3245bc18>
> return tuple(data.draw(e) for e in self.element_strategies)
.tox/py3/lib/python3.7/site-packages/hypothesis/strategies/_internal/collections.py:57:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = ConjectureData(INTERESTING, 32 bytes, frozen)
strategy = new_content().filter(lambda c: get_tests_data()["storage"].content_get_data(hash_to_bytes(c["sha1"])))
label = 10358930435738099914
def draw(self, strategy, label=None):
if self.is_find and not strategy.supports_find:
raise InvalidArgument(
(
"Cannot use strategy %r within a call to find (presumably "
"because it would be invalid after the call had ended)."
)
% (strategy,)
)
at_top_level = self.depth == 0
if at_top_level:
# We start this timer early, because accessing attributes on a LazyStrategy
# can be almost arbitrarily slow. In cases like characters() and text()
# where we cache something expensive, this led to Flaky deadline errors!
# See https://github.com/HypothesisWorks/hypothesis/issues/2108
start_time = time.perf_counter()
strategy.validate()
if strategy.is_empty:
self.mark_invalid()
if self.depth >= MAX_DEPTH:
self.mark_invalid()
if label is None:
label = strategy.label
self.start_example(label=label)
try:
if not at_top_level:
> return strategy.do_draw(self)
.tox/py3/lib/python3.7/site-packages/hypothesis/internal/conjecture/data.py:883:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = new_content().filter(lambda c: get_tests_data()["storage"].content_get_data(hash_to_bytes(c["sha1"])))
data = ConjectureData(INTERESTING, 32 bytes, frozen)
def do_draw(self, data: ConjectureData) -> Ex:
result = self.filtered_strategy.do_filtered_draw(
> data=data, filter_strategy=self
)
.tox/py3/lib/python3.7/site-packages/hypothesis/strategies/_internal/strategies.py:724:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = new_content(), data = ConjectureData(INTERESTING, 32 bytes, frozen)
filter_strategy = new_content().filter(lambda c: get_tests_data()["storage"].content_get_data(hash_to_bytes(c["sha1"])))
def do_filtered_draw(self, data, filter_strategy):
return self.wrapped_strategy.do_filtered_draw(
> data=data, filter_strategy=filter_strategy
)
.tox/py3/lib/python3.7/site-packages/hypothesis/strategies/_internal/lazy.py:154:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <hypothesis.strategies._internal.core.CompositeStrategy object at 0x7fdb3d724898>
data = ConjectureData(INTERESTING, 32 bytes, frozen)
filter_strategy = new_content().filter(lambda c: get_tests_data()["storage"].content_get_data(hash_to_bytes(c["sha1"])))
def do_filtered_draw(self, data, filter_strategy):
# Hook for strategies that want to override the behaviour of
# FilteredStrategy. Most strategies don't, so by default we delegate
# straight back to the default filtered-draw implementation.
> return filter_strategy.default_do_filtered_draw(data)
.tox/py3/lib/python3.7/site-packages/hypothesis/strategies/_internal/strategies.py:352:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = new_content().filter(lambda c: get_tests_data()["storage"].content_get_data(hash_to_bytes(c["sha1"])))
data = ConjectureData(INTERESTING, 32 bytes, frozen)
def default_do_filtered_draw(self, data):
for i in range(3):
start_index = data.index
> value = data.draw(self.filtered_strategy)
.tox/py3/lib/python3.7/site-packages/hypothesis/strategies/_internal/strategies.py:739:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = ConjectureData(INTERESTING, 32 bytes, frozen), strategy = new_content()
label = 9271044195431015810
def draw(self, strategy, label=None):
if self.is_find and not strategy.supports_find:
raise InvalidArgument(
(
"Cannot use strategy %r within a call to find (presumably "
"because it would be invalid after the call had ended)."
)
% (strategy,)
)
at_top_level = self.depth == 0
if at_top_level:
# We start this timer early, because accessing attributes on a LazyStrategy
# can be almost arbitrarily slow. In cases like characters() and text()
# where we cache something expensive, this led to Flaky deadline errors!
# See https://github.com/HypothesisWorks/hypothesis/issues/2108
start_time = time.perf_counter()
strategy.validate()
if strategy.is_empty:
self.mark_invalid()
if self.depth >= MAX_DEPTH:
self.mark_invalid()
if label is None:
label = strategy.label
self.start_example(label=label)
try:
if not at_top_level:
> return strategy.do_draw(self)
.tox/py3/lib/python3.7/site-packages/hypothesis/internal/conjecture/data.py:883:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = new_content(), data = ConjectureData(INTERESTING, 32 bytes, frozen)
def do_draw(self, data):
> return data.draw(self.wrapped_strategy)
.tox/py3/lib/python3.7/site-packages/hypothesis/strategies/_internal/lazy.py:150:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = ConjectureData(INTERESTING, 32 bytes, frozen)
strategy = <hypothesis.strategies._internal.core.CompositeStrategy object at 0x7fdb3d724898>
label = 9271044195431015810
def draw(self, strategy, label=None):
if self.is_find and not strategy.supports_find:
raise InvalidArgument(
(
"Cannot use strategy %r within a call to find (presumably "
"because it would be invalid after the call had ended)."
)
% (strategy,)
)
at_top_level = self.depth == 0
if at_top_level:
# We start this timer early, because accessing attributes on a LazyStrategy
# can be almost arbitrarily slow. In cases like characters() and text()
# where we cache something expensive, this led to Flaky deadline errors!
# See https://github.com/HypothesisWorks/hypothesis/issues/2108
start_time = time.perf_counter()
strategy.validate()
if strategy.is_empty:
self.mark_invalid()
if self.depth >= MAX_DEPTH:
self.mark_invalid()
if label is None:
label = strategy.label
self.start_example(label=label)
try:
if not at_top_level:
> return strategy.do_draw(self)
.tox/py3/lib/python3.7/site-packages/hypothesis/internal/conjecture/data.py:883:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <hypothesis.strategies._internal.core.CompositeStrategy object at 0x7fdb3d724898>
data = ConjectureData(INTERESTING, 32 bytes, frozen)
def do_draw(self, data):
> return self.definition(data.draw, *self.args, **self.kwargs)
.tox/py3/lib/python3.7/site-packages/hypothesis/strategies/_internal/core.py:1809:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
draw = <bound method ConjectureData.draw of ConjectureData(INTERESTING, 32 bytes, frozen)>
@composite
def new_content(draw):
> blake2s256_hex = draw(sha256())
.tox/py3/lib/python3.7/site-packages/swh/web/tests/strategies.py:183:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = ConjectureData(INTERESTING, 32 bytes, frozen)
strategy = binary(max_size=32, min_size=32).filter(_filter_checksum).map(hash_to_hex)
label = 10700208128082112041
def draw(self, strategy, label=None):
if self.is_find and not strategy.supports_find:
raise InvalidArgument(
(
"Cannot use strategy %r within a call to find (presumably "
"because it would be invalid after the call had ended)."
)
% (strategy,)
)
at_top_level = self.depth == 0
if at_top_level:
# We start this timer early, because accessing attributes on a LazyStrategy
# can be almost arbitrarily slow. In cases like characters() and text()
# where we cache something expensive, this led to Flaky deadline errors!
# See https://github.com/HypothesisWorks/hypothesis/issues/2108
start_time = time.perf_counter()
strategy.validate()
if strategy.is_empty:
self.mark_invalid()
if self.depth >= MAX_DEPTH:
self.mark_invalid()
if label is None:
label = strategy.label
self.start_example(label=label)
try:
if not at_top_level:
> return strategy.do_draw(self)
.tox/py3/lib/python3.7/site-packages/hypothesis/internal/conjecture/data.py:883:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = binary(max_size=32, min_size=32).filter(_filter_checksum).map(hash_to_hex)
data = ConjectureData(INTERESTING, 32 bytes, frozen)
def do_draw(self, data: ConjectureData) -> Ex:
for _ in range(3):
i = data.index
try:
data.start_example(MAPPED_SEARCH_STRATEGY_DO_DRAW_LABEL)
> result = self.pack(data.draw(self.mapped_strategy))
.tox/py3/lib/python3.7/site-packages/hypothesis/strategies/_internal/strategies.py:650:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = ConjectureData(INTERESTING, 32 bytes, frozen)
strategy = binary(max_size=32, min_size=32).filter(_filter_checksum)
label = 10358930435738099914
def draw(self, strategy, label=None):
if self.is_find and not strategy.supports_find:
raise InvalidArgument(
(
"Cannot use strategy %r within a call to find (presumably "
"because it would be invalid after the call had ended)."
)
% (strategy,)
)
at_top_level = self.depth == 0
if at_top_level:
# We start this timer early, because accessing attributes on a LazyStrategy
# can be almost arbitrarily slow. In cases like characters() and text()
# where we cache something expensive, this led to Flaky deadline errors!
# See https://github.com/HypothesisWorks/hypothesis/issues/2108
start_time = time.perf_counter()
strategy.validate()
if strategy.is_empty:
self.mark_invalid()
if self.depth >= MAX_DEPTH:
self.mark_invalid()
if label is None:
label = strategy.label
self.start_example(label=label)
try:
if not at_top_level:
> return strategy.do_draw(self)
.tox/py3/lib/python3.7/site-packages/hypothesis/internal/conjecture/data.py:883:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = binary(max_size=32, min_size=32).filter(_filter_checksum)
data = ConjectureData(INTERESTING, 32 bytes, frozen)
def do_draw(self, data: ConjectureData) -> Ex:
result = self.filtered_strategy.do_filtered_draw(
> data=data, filter_strategy=self
)
.tox/py3/lib/python3.7/site-packages/hypothesis/strategies/_internal/strategies.py:724:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = binary(max_size=32, min_size=32)
data = ConjectureData(INTERESTING, 32 bytes, frozen)
filter_strategy = binary(max_size=32, min_size=32).filter(_filter_checksum)
def do_filtered_draw(self, data, filter_strategy):
return self.wrapped_strategy.do_filtered_draw(
> data=data, filter_strategy=filter_strategy
)
.tox/py3/lib/python3.7/site-packages/hypothesis/strategies/_internal/lazy.py:154:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <hypothesis.strategies._internal.strings.FixedSizeBytes object at 0x7fdb36b352e8>
data = ConjectureData(INTERESTING, 32 bytes, frozen)
filter_strategy = binary(max_size=32, min_size=32).filter(_filter_checksum)
def do_filtered_draw(self, data, filter_strategy):
# Hook for strategies that want to override the behaviour of
# FilteredStrategy. Most strategies don't, so by default we delegate
# straight back to the default filtered-draw implementation.
> return filter_strategy.default_do_filtered_draw(data)
.tox/py3/lib/python3.7/site-packages/hypothesis/strategies/_internal/strategies.py:352:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = binary(max_size=32, min_size=32).filter(_filter_checksum)
data = ConjectureData(INTERESTING, 32 bytes, frozen)
def default_do_filtered_draw(self, data):
for i in range(3):
start_index = data.index
> value = data.draw(self.filtered_strategy)
.tox/py3/lib/python3.7/site-packages/hypothesis/strategies/_internal/strategies.py:739:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = ConjectureData(INTERESTING, 32 bytes, frozen)
strategy = binary(max_size=32, min_size=32), label = 11736445889146861131
def draw(self, strategy, label=None):
if self.is_find and not strategy.supports_find:
raise InvalidArgument(
(
"Cannot use strategy %r within a call to find (presumably "
"because it would be invalid after the call had ended)."
)
% (strategy,)
)
at_top_level = self.depth == 0
if at_top_level:
# We start this timer early, because accessing attributes on a LazyStrategy
# can be almost arbitrarily slow. In cases like characters() and text()
# where we cache something expensive, this led to Flaky deadline errors!
# See https://github.com/HypothesisWorks/hypothesis/issues/2108
start_time = time.perf_counter()
strategy.validate()
if strategy.is_empty:
self.mark_invalid()
if self.depth >= MAX_DEPTH:
self.mark_invalid()
if label is None:
label = strategy.label
self.start_example(label=label)
try:
if not at_top_level:
> return strategy.do_draw(self)
.tox/py3/lib/python3.7/site-packages/hypothesis/internal/conjecture/data.py:883:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = binary(max_size=32, min_size=32)
data = ConjectureData(INTERESTING, 32 bytes, frozen)
def do_draw(self, data):
> return data.draw(self.wrapped_strategy)
.tox/py3/lib/python3.7/site-packages/hypothesis/strategies/_internal/lazy.py:150:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = ConjectureData(INTERESTING, 32 bytes, frozen)
strategy = <hypothesis.strategies._internal.strings.FixedSizeBytes object at 0x7fdb36b352e8>
label = 11736445889146861131
def draw(self, strategy, label=None):
if self.is_find and not strategy.supports_find:
raise InvalidArgument(
(
"Cannot use strategy %r within a call to find (presumably "
"because it would be invalid after the call had ended)."
)
% (strategy,)
)
at_top_level = self.depth == 0
if at_top_level:
# We start this timer early, because accessing attributes on a LazyStrategy
# can be almost arbitrarily slow. In cases like characters() and text()
# where we cache something expensive, this led to Flaky deadline errors!
# See https://github.com/HypothesisWorks/hypothesis/issues/2108
start_time = time.perf_counter()
strategy.validate()
if strategy.is_empty:
self.mark_invalid()
if self.depth >= MAX_DEPTH:
self.mark_invalid()
if label is None:
label = strategy.label
self.start_example(label=label)
try:
if not at_top_level:
> return strategy.do_draw(self)
.tox/py3/lib/python3.7/site-packages/hypothesis/internal/conjecture/data.py:883:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <hypothesis.strategies._internal.strings.FixedSizeBytes object at 0x7fdb36b352e8>
data = ConjectureData(INTERESTING, 32 bytes, frozen)
def do_draw(self, data):
> return bytes(data.draw_bytes(self.size))
.tox/py3/lib/python3.7/site-packages/hypothesis/strategies/_internal/strings.py:107:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = ConjectureData(INTERESTING, 32 bytes, frozen), n = 32
def draw_bytes(self, n):
"""Draw n bytes from the underlying source."""
> return int_to_bytes(self.draw_bits(8 * n), n)
.tox/py3/lib/python3.7/site-packages/hypothesis/internal/conjecture/data.py:1031:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = ConjectureData(INTERESTING, 32 bytes, frozen), n = 256
def draw_bits(self, n, *, forced=None):
"""Return an ``n``-bit integer from the underlying source of
bytes. If ``forced`` is set to an integer will instead
ignore the underlying source and simulate a draw as if it had
returned that integer."""
self.__assert_not_frozen("draw_bits")
if n == 0:
return 0
assert n > 0
n_bytes = bits_to_bytes(n)
self.__check_capacity(n_bytes)
if forced is not None:
buf = int_to_bytes(forced, n_bytes)
elif self.__bytes_drawn < len(self.__prefix):
index = self.__bytes_drawn
buf = self.__prefix[index : index + n_bytes]
if len(buf) < n_bytes:
buf += uniform(self.__random, n_bytes - len(buf))
else:
buf = uniform(self.__random, n_bytes)
buf = bytearray(buf)
self.__bytes_drawn += n_bytes
assert len(buf) == n_bytes
# If we have a number of bits that is not a multiple of 8
# we have to mask off the high bits.
buf[0] &= BYTE_MASKS[n % 8]
buf = bytes(buf)
result = int_from_bytes(buf)
> self.observer.draw_bits(n, forced is not None, result)
.tox/py3/lib/python3.7/site-packages/hypothesis/internal/conjecture/data.py:1013:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <hypothesis.internal.conjecture.datatree.TreeRecordingObserver object at 0x7fdb3245bfd0>
n_bits = 256, forced = False, value = 803202024401497237...7772677134755382255
def draw_bits(self, n_bits, forced, value):
i = self.__index_in_current_node
self.__index_in_current_node += 1
node = self.__current_node
assert len(node.bit_lengths) == len(node.values)
if i < len(node.bit_lengths):
if n_bits != node.bit_lengths[i]:
> inconsistent_generation()
.tox/py3/lib/python3.7/site-packages/hypothesis/internal/conjecture/datatree.py:337:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def inconsistent_generation():
raise Flaky(
> "Inconsistent data generation! Data generation behaved differently "
"between different runs. Is your data generation depending on external "
"state?"
)
E hypothesis.errors.Flaky: Inconsistent data generation! Data generation behaved differently between different runs. Is your data generation depending on external state?
.tox/py3/lib/python3.7/site-packages/hypothesis/internal/conjecture/datatree.py:36: Flaky
During handling of the above exception, another exception occurred:
@given(
> unknown_content(),
unknown_directory(),
unknown_release(),
unknown_revision(),
unknown_snapshot(),
)
def test_lookup_unknown_objects(
unknown_content,
unknown_directory,
unknown_release,
unknown_revision,
unknown_snapshot,
):
.tox/py3/lib/python3.7/site-packages/swh/web/tests/common/test_archive.py:865:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/py3/lib/python3.7/site-packages/hypothesis/core.py:726: in _execute_once_for_engine
data.mark_interesting((type(e), filename, lineno))
.tox/py3/lib/python3.7/site-packages/hypothesis/internal/conjecture/data.py:1055: in mark_interesting
self.conclude_test(Status.INTERESTING, interesting_origin)
.tox/py3/lib/python3.7/site-packages/hypothesis/internal/conjecture/data.py:1051: in conclude_test
self.freeze()
.tox/py3/lib/python3.7/site-packages/hypothesis/internal/conjecture/data.py:979: in freeze
self.observer.conclude_test(self.status, self.interesting_origin)
.tox/py3/lib/python3.7/site-packages/hypothesis/internal/conjecture/datatree.py:408: in conclude_test
inconsistent_generation()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def inconsistent_generation():
raise Flaky(
> "Inconsistent data generation! Data generation behaved differently "
"between different runs. Is your data generation depending on external "
"state?"
)
E hypothesis.errors.Flaky: Inconsistent data generation! Data generation behaved differently between different runs. Is your data generation depending on external state?
.tox/py3/lib/python3.7/site-packages/hypothesis/internal/conjecture/datatree.py:36: Flaky
TEST RESULT
TEST RESULT
- Run At
- Nov 26 2020, 6:22 PM