1

I am trying to solve a puzzle using Hypothesis similar to what has been done here:

http://nchammas.com/writing/how-not-to-die-hard-with-hypothesis

Unfortunately it fails intermittently with the Flaky error and I am not able to track down the problem using pdb.

My program source is at:

https://gist.github.com/sureshvv/0fb78ef221fb8c1ed85dd034c83abefa

It can be run using py.test.

Any assistance to diagnose and solve the problem appreciated.

sureshvv
  • 4,234
  • 1
  • 26
  • 32
  • Tried to reproduce but could not see any error when I ran your code: https://gist.github.com/c3fcc74398981fdf14cff8ce9a0ba77f I use python 3.6, py.test 3.1.1, hypothesis 3.11.1 – MarSoft Jun 06 '17 at 21:56
  • I have since fixed it. The problem was caused by calling random.samole inside my rule rather than using st.choices. Thank you for your attention. – sureshvv Jun 07 '17 at 11:31

1 Answers1

1

Problem was caused because of calling random.sample inside my rule. Need to use the strategies.choices() instead.

sureshvv
  • 4,234
  • 1
  • 26
  • 32