-
-
Notifications
You must be signed in to change notification settings - Fork 46.6k
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
Test cases for check_bipartite_graph_bfs #10688
Test cases for check_bipartite_graph_bfs #10688
Conversation
>>> check_bipartite( | ||
... {0: [1, 3], 1: [0, 2], 2: [1, 3], 3: [0, 2], 4: [0]} | ||
... ) | ||
False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add some negative values, floating point values, and some strings.
Also,
{}
{7: [1, 3], 1: [0, 2], 2: [1, 3], 3: [0, 2], 4: [0]}
{0: [1, 3], 1: [0, 2], 2: [1, 3], 3: [0, 2], 9: [0]}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the additional test cases! I'll have to refactor the code a bit as it assumes that there's keys for all values from 0 to n. Will add different data types as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is OK to fail if the input is not 1 to n or if other garbage data is provided. We just want to ensure the code does safe things in the face of garbage data. Raising a ValueError is safe.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Understood. Thanks for the clarification!
for more information, see https://pre-commit.ci
… check_bipartite_graph_bfs_tests
…RaymondDashWu/Python into check_bipartite_graph_bfs_tests
The only failing error deals with an issue mentioned in #10717. I'll be moving on to another PR until that's fixed. |
* [ADD] tests for check_bipartite_graph_bfs * linter fix? * linter fix * [ADD] more test cases check_bipartite_graph_bfs * doctest fixes. Forgot to add 'Traceback...' * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * missed a Traceback * Update check_bipartite_graph_bfs.py --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Christian Clauss <cclauss@me.com>
Describe your change:
Contributes to #9943 . For maintainers: The automated tester is saying L65 needs tests but I'm not sure what it's asking for.
Checklist: