A script for reproduction
from hypothesis import strategies as st
from hypothesis.stateful import (
Bundle,
RuleBasedStateMachine,
consumes,
initialize,
rule,
)
class Reproduction(RuleBasedStateMachine):
my_bundle = Bundle('my_bundle')
@initialize(target=my_bundle)
def set_initial(self, /) -> str:
return 'sample text'
@rule(
character=consumes(my_bundle).flatmap(
lambda value: st.sampled_from(value)
)
)
def check(self, /, *, character: str):
assert isinstance(character, str)
assert len(character) == 1
TestCase = Reproduction.TestCase