示例#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
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