'TreeNode' object has no attribute 'is_exhausted' Error while running simple python program using hypothesis

2 weeks ago 20
ARTICLE AD BOX
from hypothesis import given, strategies as st @given(st.integers()) def test_integers(n): print(f"called with {n}") assert isinstance(n, int) test_integers() --------------------------------------------------------------------------- File ~\anaconda3\envs\m4pro\lib\site-packages\hypothesis\internal\conjecture\datatree.py:498, in TreeNode.check_exhausted(self) 480 def check_exhausted(self) -> bool: 481 """ 482 Recalculates is_exhausted if necessary, and then returns it. 483 (...) 493 - We exhaust any of its children 494 """ 496 if ( 497 # a node cannot go from is_exhausted -> not is_exhausted. --> 498 not self.is_exhausted 499 # if we don't know what happens after this node, we don't have 500 # enough information to tell if it's exhausted. 501 and self.transition is not None 502 # if there are still any nodes left which are the only child of their 503 # parent (len(self.values) > 0), then this TreeNode must be not 504 # exhausted, unless all of those nodes were forced. 505 # 506 # This is because we maintain an invariant of only adding nodes to 507 # DataTree which have at least 2 possible values, so we know that if 508 # they do not have any siblings that we still have more choices to 509 # discover. 510 # 511 # (We actually *do* currently add single-valued nodes to the tree, 512 # but immediately split them into a transition to avoid falsifying 513 # this check. this is a bit of a hack.) 514 and len(self.forced) == len(self.values) 515 ): 516 if isinstance(self.transition, (Conclusion, Killed)): 517 self.is_exhausted = True

AttributeError: 'TreeNode' object has no attribute 'is_exhausted'

Python version: 3.10.0 Hypothesis version: 6.151.12

After googling, found no solution about this Should I change code of hypothesis library? Though I don't have such skills

Read Entire Article