Skip to content

Instantly share code, notes, and snippets.

@MarSoft
Created June 6, 2017 21:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MarSoft/c3fcc74398981fdf14cff8ce9a0ba77f to your computer and use it in GitHub Desktop.
Save MarSoft/c3fcc74398981fdf14cff8ce9a0ba77f to your computer and use it in GitHub Desktop.
============================= test session starts ==============================
platform linux -- Python 3.6.1, pytest-3.1.1, py-1.4.34, pluggy-0.4.0
rootdir: /tmp/x, inifile:
plugins: xdist-1.16.0, hypothesis-3.11.1
collected 1 items
so.py F
=================================== FAILURES ===================================
_____________________________ DieHardTest.runTest ______________________________
self = <hypothesis.stateful.BoatProblem.TestCase testMethod=runTest>
def runTest(self):
> run_state_machine_as_test(state_machine_class)
../env/lib/python3.6/site-packages/hypothesis/stateful.py:191:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../env/lib/python3.6/site-packages/hypothesis/stateful.py:109: in run_state_machine_as_test
breaker.run(state_machine_factory(), print_steps=True)
../env/lib/python3.6/site-packages/hypothesis/stateful.py:250: in run
state_machine.check_invariants()
../env/lib/python3.6/site-packages/hypothesis/stateful.py:595: in check_invariants
invar.function(self)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = BoatProblem({})
@invariant()
def problem_solved(self):
persons = [x for x in self.persons if x.crossed]
if len(persons) == 4 and self.flash_light.crossed:
if self.total_time not in self.solutions:
self.solutions[self.total_time] = self.moves
self.write_notes()
# 5 is by trial and error. Seems like the max number of solutions is 6
if len(self.solutions) > 5:
> assert False
E AssertionError: assert False
so.py:65: AssertionError
---------------------------------- Hypothesis ----------------------------------
Step #1: make_forward_move(choice=choice)
Choice #1: <Person: crossed=False time_taken=1>
Choice #2: <Person: crossed=False time_taken=2>
Step #2: make_return_move()
Step #3: make_forward_move(choice=choice)
Choice #3: <Person: crossed=False time_taken=1>
Choice #4: <Person: crossed=False time_taken=5>
Step #4: make_return_move()
Step #5: make_forward_move(choice=choice)
Choice #5: <Person: crossed=False time_taken=1>
Choice #6: <Person: crossed=False time_taken=10>
timings: [19, 20, 21, 23, 17, 24]
[1, 2]
[1]
[10, 5]
[2]
[1, 2]
min timing: 17
=========================== 1 failed in 0.11 seconds ===========================
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment