Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI Failure for select() in test_select_rank(). Works locally. #566

Open
Kishan-Ved opened this issue Jul 7, 2024 · 0 comments
Open

CI Failure for select() in test_select_rank(). Works locally. #566

Kishan-Ved opened this issue Jul 7, 2024 · 0 comments

Comments

@Kishan-Ved
Copy link
Contributor

Description of the problem

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

This was added in the PR: #564

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant