-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Increased test coverage algorithms/matching.py #6095
Conversation
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.
LGTM, thanks @Mjh9122 - it'd be an improvement to use pytest.raises
as a context manager and check against the exception messages (as well as fix the pytest import pattern), but that should be handled in a separate PR to address the whole file. Very nice additions to improve coverage!
@@ -450,7 +450,7 @@ def test_selfloops(self): | |||
assert not nx.is_matching(G, {(0, 0), (1, 2), (2, 3)}) | |||
# selfloop edge in G | |||
G.add_edge(0, 0) | |||
assert not nx.is_matching(G, {(0, 0), (1, 2), (2, 3)}) | |||
assert not nx.is_matching(G, {(0, 0), (1, 2)}) |
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.
Very nice catch - as originally written, the test was not hitting the intended branch!
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 @Mjh9122!
Increased test coverage in is_matching, is_maximal_matching, is_perfect_matching
Increased test coverage in is_matching, is_maximal_matching, is_perfect_matching
Increased test coverage in is_matching, is_maximal_matching, is_perfect_matching
Black ran. Added some tests in test_matching.py to hit some untested conditionals. Should get coverage up to around 97 from 94.