I'm working on the insert function for containers/BST.py. Right now, when I run:
python3 -m pytest tests/test_BST.py -k insert -x
the first error I get is:
_____________________________ test__BST_insert ______________________________
@given(xs=ints)
> def test__BST_insert(xs):
tests/test_BST.py:92:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
xs = [0]
@given(xs=ints)
def test__BST_insert(xs):
xs = list(set(xs))
bst = BST()
for x in xs:
bst.insert(x)
> assert x in bst.to_list('inorder')
E AssertionError: assert 0 in []
E + where [] = <bound method BinaryTree.to_list of BST([])>('inorder')
E + where <bound method BinaryTree.to_list of BST([])> = BST([]).to_list
tests/test_BST.py:97: AssertionError
-------------------------------------- Hypothesis ---------------------------------------
Falsifying example: test__BST_insert(
xs=[0],
)
I'm a bit confused by what the error message is saying the issue is and where I should look. Should I look at my insert function or my to_list function of the BinaryTree class in containers/Binary_Tree.py? Thanks.
I'm working on the
insert
function forcontainers/BST.py
. Right now, when I run:python3 -m pytest tests/test_BST.py -k insert -x
the first error I get is:
I'm a bit confused by what the error message is saying the issue is and where I should look. Should I look at my
insert
function or myto_list
function of theBinaryTree
class incontainers/Binary_Tree.py
? Thanks.