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

Increased test coverage algorithms/matching.py #6095

Merged
merged 1 commit into from
Oct 31, 2022

Conversation

Mjh9122
Copy link
Contributor

@Mjh9122 Mjh9122 commented Oct 18, 2022

Black ran. Added some tests in test_matching.py to hit some untested conditionals. Should get coverage up to around 97 from 94.

@Mjh9122 Mjh9122 changed the title Increased test coverage in is_matching, is_maximal_matching, is_perfe… Increased test coverage algorithms/matching.py Oct 18, 2022
Copy link
Contributor

@rossbar rossbar left a 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)})
Copy link
Contributor

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!

Copy link
Member

@MridulS MridulS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Mjh9122!

@MridulS MridulS merged commit 8ba9937 into networkx:main Oct 31, 2022
@jarrodmillman jarrodmillman added this to the networkx-2.8.8 milestone Oct 31, 2022
jarrodmillman pushed a commit that referenced this pull request Nov 1, 2022
Increased test coverage in is_matching, is_maximal_matching, is_perfect_matching
@Mjh9122 Mjh9122 deleted the matching-test-expansion branch November 3, 2022 18:30
MridulS pushed a commit to MridulS/networkx that referenced this pull request Feb 4, 2023
Increased test coverage in is_matching, is_maximal_matching, is_perfect_matching
cvanelteren pushed a commit to cvanelteren/networkx that referenced this pull request Apr 22, 2024
Increased test coverage in is_matching, is_maximal_matching, is_perfect_matching
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants