self = <hypothesis.core.StateForActualGivenExecution object at 0x7f8250769048>
data = ConjectureData(INTERESTING, 20 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:
trace = frozenset()
if (
self.failed_normally
and not self.failed_due_to_deadline
and Phase.shrink in self.settings.phases
and Phase.explain in self.settings.phases
and sys.gettrace() is None
and not PYPY
): # pragma: no cover
# This is in fact covered by our *non-coverage* tests, but due to the
# settrace() contention *not* by our coverage tests. Ah well.
tracer = Tracer()
try:
sys.settrace(tracer.trace)
result = self.execute_once(data)
if data.status == Status.VALID:
self.explain_traces[None].add(frozenset(tracer.branches))
finally:
sys.settrace(None)
trace = frozenset(tracer.branches)
else:
> result = self.execute_once(data)
.tox/py3/lib/python3.7/site-packages/hypothesis/core.py:690:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <hypothesis.core.StateForActualGivenExecution object at 0x7f8250769048>
data = ConjectureData(INTERESTING, 20 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()
for i, (k, v) in enumerate(kwargs.items()):
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:624:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
data = ConjectureData(INTERESTING, 20 bytes, frozen)
function = <function StateForActualGivenExecution.execute_once.<locals>.run at 0x7f825072fea0>
def default_new_style_executor(data, function):
> return function(data)
.tox/py3/lib/python3.7/site-packages/hypothesis/executors.py:52:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
data = ConjectureData(INTERESTING, 20 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:583:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = ConjectureData(INTERESTING, 20 bytes, frozen)
strategy = WithRunner(TupleStrategy((just(()), fixed_dictionaries({'new_revision': new_revision()}).map(lambda args: dict(args, **kwargs)))), runner=<swh.web.tests.conftest._ArchiveData object at 0x7f8252ea63c8>)
label = 12316132609319002662
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:888:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = WithRunner(TupleStrategy((just(()), fixed_dictionaries({'new_revision': new_revision()}).map(lambda args: dict(args, **kwargs)))), runner=<swh.web.tests.conftest._ArchiveData object at 0x7f8252ea63c8>)
data = ConjectureData(INTERESTING, 20 bytes, frozen)
def do_draw(self, data):
data.hypothesis_runner = self.runner
> return self.mapped_strategy.do_draw(data)
.tox/py3/lib/python3.7/site-packages/hypothesis/core.py:222:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = TupleStrategy((just(()), fixed_dictionaries({'new_revision': new_revision()}).map(lambda args: dict(args, **kwargs))))
data = ConjectureData(INTERESTING, 20 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:61:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.0 = <tuple_iterator object at 0x7f8250755ac8>
> return tuple(data.draw(e) for e in self.element_strategies)
.tox/py3/lib/python3.7/site-packages/hypothesis/strategies/_internal/collections.py:61:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = ConjectureData(INTERESTING, 20 bytes, frozen)
strategy = fixed_dictionaries({'new_revision': new_revision()}).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:884:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = fixed_dictionaries({'new_revision': new_revision()}).map(lambda args: dict(args, **kwargs))
data = ConjectureData(INTERESTING, 20 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:812:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = ConjectureData(INTERESTING, 20 bytes, frozen)
strategy = fixed_dictionaries({'new_revision': new_revision()})
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:884:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = fixed_dictionaries({'new_revision': new_revision()})
data = ConjectureData(INTERESTING, 20 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:168:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = ConjectureData(INTERESTING, 20 bytes, frozen)
strategy = FixedKeysDictStrategy(('new_revision',), TupleStrategy((new_revision())))
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:884:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = FixedKeysDictStrategy(('new_revision',), TupleStrategy((new_revision())))
data = ConjectureData(INTERESTING, 20 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:812:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = ConjectureData(INTERESTING, 20 bytes, frozen)
strategy = TupleStrategy((new_revision())), label = 14943125527945371948
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:884:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = TupleStrategy((new_revision()))
data = ConjectureData(INTERESTING, 20 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:61:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.0 = <tuple_iterator object at 0x7f8250755898>
> return tuple(data.draw(e) for e in self.element_strategies)
.tox/py3/lib/python3.7/site-packages/hypothesis/strategies/_internal/collections.py:61:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = ConjectureData(INTERESTING, 20 bytes, frozen), strategy = new_revision()
label = 10229430183883503684
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:884:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = new_revision(), data = ConjectureData(INTERESTING, 20 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:168:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = ConjectureData(INTERESTING, 20 bytes, frozen)
strategy = <hypothesis.strategies._internal.core.CompositeStrategy object at 0x7f825097ee80>
label = 10229430183883503684
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:884:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <hypothesis.strategies._internal.core.CompositeStrategy object at 0x7f825097ee80>
data = ConjectureData(INTERESTING, 20 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:1401:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
draw = <bound method ConjectureData.draw of ConjectureData(INTERESTING, 20 bytes, frozen)>
@composite
def new_revision(draw):
"""
Hypothesis strategy returning random raw swh revision data
not ingested into the test archive.
"""
return Revision(
> directory=draw(sha1().map(hash_to_bytes)),
author=draw(new_person()),
committer=draw(new_person()),
message=draw(text(min_size=20, max_size=100).map(lambda t: t.encode())),
date=TimestampWithTimezone.from_datetime(draw(new_swh_date())),
committer_date=TimestampWithTimezone.from_datetime(draw(new_swh_date())),
synthetic=False,
type=RevisionType.GIT,
)
.tox/py3/lib/python3.7/site-packages/swh/web/tests/strategies.py:462:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = ConjectureData(INTERESTING, 20 bytes, frozen)
strategy = binary(max_size=20, min_size=20).filter(_filter_checksum).map(hash_to_hex).map(hash_to_bytes)
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:884:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = binary(max_size=20, min_size=20).filter(_filter_checksum).map(hash_to_hex).map(hash_to_bytes)
data = ConjectureData(INTERESTING, 20 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:812:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = ConjectureData(INTERESTING, 20 bytes, frozen)
strategy = binary(max_size=20, min_size=20).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:884:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = binary(max_size=20, min_size=20).filter(_filter_checksum).map(hash_to_hex)
data = ConjectureData(INTERESTING, 20 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:812:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = ConjectureData(INTERESTING, 20 bytes, frozen)
strategy = binary(max_size=20, min_size=20).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:884:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = binary(max_size=20, min_size=20).filter(_filter_checksum)
data = ConjectureData(INTERESTING, 20 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:168:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = ConjectureData(INTERESTING, 20 bytes, frozen)
strategy = <hypothesis.strategies._internal.strings.FixedSizeBytes object at 0x7f82507555c0>.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:884:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <hypothesis.strategies._internal.strings.FixedSizeBytes object at 0x7f82507555c0>.filter(_filter_checksum)
data = ConjectureData(INTERESTING, 20 bytes, frozen)
def do_draw(self, data: ConjectureData) -> Ex:
> result = self.do_filtered_draw(data)
.tox/py3/lib/python3.7/site-packages/hypothesis/strategies/_internal/strategies.py:918:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <hypothesis.strategies._internal.strings.FixedSizeBytes object at 0x7f82507555c0>.filter(_filter_checksum)
data = ConjectureData(INTERESTING, 20 bytes, frozen)
def do_filtered_draw(self, data):
for i in range(3):
start_index = data.index
data.start_example(FILTERED_SEARCH_STRATEGY_DO_DRAW_LABEL)
value = data.draw(self.filtered_strategy)
if self.condition(value):
data.stop_example()
return value
else:
> data.stop_example(discard=True)
.tox/py3/lib/python3.7/site-packages/hypothesis/strategies/_internal/strategies.py:938:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = ConjectureData(INTERESTING, 20 bytes, frozen), discard = True
def stop_example(self, discard=False):
if self.frozen:
return
if discard:
self.has_discards = True
self.depth -= 1
assert self.depth >= -1
self.__example_record.stop_example(discard)
labels_for_structure = self.labels_for_structure_stack.pop()
if not discard:
if self.labels_for_structure_stack:
self.labels_for_structure_stack[-1].update(labels_for_structure)
else:
self.tags.update([structural_coverage(l) for l in labels_for_structure])
if discard:
# Once we've discarded an example, every test case starting with
# this prefix contains discards. We prune the tree at that point so
# as to avoid future test cases bothering with this region, on the
# assumption that some example that you could have used instead
# there would *not* trigger the discard. This greatly speeds up
# test case generation in some cases, because it allows us to
# ignore large swathes of the search space that are effectively
# redundant.
#
# A scenario that can cause us problems but which we deliberately
# have decided not to support is that if there are side effects
# during data generation then you may end up with a scenario where
# every good test case generates a discard because the discarded
# section sets up important things for later. This is not terribly
# likely and all that you see in this case is some degradation in
# quality of testing, so we don't worry about it.
#
# Note that killing the branch does *not* mean we will never
# explore below this point, and in particular we may do so during
# shrinking. Any explicit request for a data object that starts
# with the branch here will work just fine, but novel prefix
# generation will avoid it, and we can use it to detect when we
# have explored the entire tree (up to redundancy).
> self.observer.kill_branch()
.tox/py3/lib/python3.7/site-packages/hypothesis/internal/conjecture/data.py:950:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <hypothesis.internal.conjecture.datatree.TreeRecordingObserver object at 0x7f82513294a8>
def kill_branch(self):
"""Mark this part of the tree as not worth re-exploring."""
if self.killed:
return
self.killed = True
if self.__index_in_current_node < len(self.__current_node.values) or (
self.__current_node.transition is not None
and not isinstance(self.__current_node.transition, Killed)
):
> inconsistent_generation()
.tox/py3/lib/python3.7/site-packages/hypothesis/internal/conjecture/datatree.py:380:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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:35: Flaky
During handling of the above exception, another exception occurred:
archive_data = <swh.web.tests.conftest._ArchiveData object at 0x7f8252ea63c8>
@given(new_revision())
> def test_lookup_directory_with_revision_unknown_content(archive_data, new_revision):
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/swh/web/tests/common/test_archive.py:384: Flaky
TEST RESULT
TEST RESULT
- Run At
- Aug 12 2021, 3:52 PM