In the file: pydatastructs/trees/tests/test_binary_trees.py, inside the _test_AVLTree() function, there is a function called test_select_rank(). This contains a code snippet (that tests the select() method) which is run only when the backend is Python. This is because if we run them in C++ backend, some CI checks fail. However, the code passes when run on my local machine (laptop - Ubuntu). This is the test_select_rank() function:
def test_select_rank(expected_output):
if backend==Backend.PYTHON:
output = []
for i in range(len(expected_output)):
output.append(a5.select(i + 1).key)
assert output == expected_output
output = []
expected_ranks = [i + 1 for i in range(len(expected_output))]
for i in range(len(expected_output)):
output.append(a5.rank(expected_output[i]))
assert output == expected_ranks
Notice the snippet that runs only when the backend is PYTHON:
if backend==Backend.PYTHON:
output = []
for i in range(len(expected_output)):
output.append(a5.select(i + 1).key)
assert output == expected_output
Description of the problem
In the file:
pydatastructs/trees/tests/test_binary_trees.py
, inside the _test_AVLTree() function, there is a function calledtest_select_rank()
. This contains a code snippet (that tests the select() method) which is run only when the backend is Python. This is because if we run them in C++ backend, some CI checks fail. However, the code passes when run on my local machine (laptop - Ubuntu). This is thetest_select_rank()
function:Notice the snippet that runs only when the backend is PYTHON:
This was added in the PR: https://github.com/codezonediitj/pydatastructs/pull/564