Repository navigation
TST: Test maintenance for test_clique.py - #8214
Merged
Merged
Conversation
rossbar
approved these changes
Jul 2, 2026
toastmt
pushed a commit
to toastmt/networkx
that referenced
this pull request
Jul 2, 2026
* Parametrize `find_cliques` tests * Get rid of `setup` method, use fixtures instead * Parametrize `node_clique_number` and `number_of_cliques` tests * Parametrize on graph type in directed graph tests, rename trivial -> null
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR follows up on #8211.
Note to reviewers: rather annoyingly, the
diffgot messed up because of indentation changes getting rid of the classes. Reviewing commit-by-commit might make things easier to follow. The following functions are unchanged (except for indentation because they are no longer part of a class and use of fixtures instead ofsetup-based class attributes):test_make_clique_bipartite,test_make_max_clique_graph,test_make_max_clique_graph_create_using,test_enumerate_all_cliques.The changes can be summarized as follows:
setupmethod, this PR usespytestfixtures instead. One of those fixtures is thefind_clique_fnwhich is eithernx.find_cliquesornx.find_cliques_recursive. This allows us to get rid of about half theassertstatements.node_clique_numberandnumber_of_cliquesinto two separate (parametrized) test functions, one for the default args, and one for thenodesarg.