예제 #1
0
파일: debug.py 프로젝트: kbara/hypothesis
def minimal_element(strategy, random):
    element = some_template(strategy, random)
    while True:
        for new_element in strategy.full_simplify(random, element):
            try:
                strategy.reify(new_element)
                element = new_element
                break
            except UnsatisfiedAssumption:
                pass
        else:
            break
    return element
예제 #2
0
def minimal_element(strategy, random):
    element = some_template(strategy, random)
    while True:
        for new_element in strategy.full_simplify(random, element):
            try:
                strategy.reify(new_element)
                element = new_element
                break
            except UnsatisfiedAssumption:
                pass
        else:
            break
    return element
예제 #3
0
파일: debug.py 프로젝트: thedrow/hypothesis
def minimal_element(strategy, random):
    tracker = Tracker()
    element = some_template(strategy, random)
    while True:
        for new_element in strategy.full_simplify(random, element):
            if tracker.track(new_element) > 1:
                continue
            try:
                with BuildContext():
                    strategy.reify(new_element)
                element = new_element
                break
            except UnsatisfiedAssumption:
                pass
        else:
            break
    return element
예제 #4
0
def test_can_full_simplify_breaking_example(machine):
    runner = machine.find_breaking_runner()
    strategy = StateMachineSearchStrategy()
    r = Random(1)
    for _ in strategy.full_simplify(r, runner):
        pass
예제 #5
0
def test_can_full_simplify_breaking_example(machine):
    runner = machine.find_breaking_runner()
    strategy = StateMachineSearchStrategy()
    r = Random(1)
    for _ in strategy.full_simplify(r, runner):
        pass