Repository navigation
Conversation
Eleven test methods share a name with an earlier method in the same class, so Python keeps only the last definition and the earlier one never runs. The collected count goes from 1152 to 1161. Nine are renames of the MISNAMED definition, which the body makes unambiguous: - test_dataio_newick_reader_rooting.py, in all four interpreter classes: the first of each pair parses "&u" and is named ...ucase, while its neighbour parses "&U". Renamed to ...lcase, matching test_with_rooted_token_lcase already in each class. - test_datamodel_tree_structure_and_iteration.py: the second test_leaf_node_iter_filtered calls ageorder_node_iter and sits in the Age-Order section beside test_ageorder_node_iter_unfiltered. - test_datamodel_charmatrix.py: the second test_setitem_by_idx_not_in_namespace subscripts by LABEL and expects KeyError; the second test_fill_taxa calls pack(), in CharacterMatrixFillAndPackTestCase. - test_datamodel_tree_list.py: the second test_remove calls tlist.reverse(). - test_dataio_tokenizer.py: the second test_comments captures comments into a dict rather than skipping them. Two are deletions, where the surviving definition already covers the dead one: - test_phylogenetic_distance_matrix.py: the two bodies are identical. - test_datamodel_tree_construction_copying_and_identity.py: the dead one is a strict prefix of the one that runs.
|
Good catch thanks @dylanpulver We should add this to our lint rules so it doesn't happen. Would you be up to add that to this PR? Also, please disclose agentic AI use. I assume this PR is agentic in nature? |
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #263 +/- ##
==========================================
+ Coverage 89.16% 89.59% +0.42%
==========================================
Files 116 116
Lines 13406 13386 -20
==========================================
+ Hits 11954 11993 +39
+ Misses 1452 1393 -59
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
mmore500
left a comment
There was a problem hiding this comment.
Thanks for the contribution! Some suggestions
| self.assertNotEqual(tree1.label, "tree2") | ||
| self.assertNotEqual(tree1.label, tree2.label) | ||
|
|
||
| def test_construction_from_given_seed_node(self): |
There was a problem hiding this comment.
Why deletions? Are these just straight up duplications of another test?
| obs_maxt = self.pdm.max_pairwise_distance_taxa(is_weighted_edge_distances=True) | ||
| self.assertEqual(set(obs_maxt), maxt) | ||
|
|
||
| def test_max_pairwise_weighted_distance_taxa(self): |
- rooting tests: keep the "&u" tests as ...ucase and rename the "&U" twins to ...Ucase, as requested, instead of renaming the lowercase ones to lcase. - charmatrix: test_pack -> test_pack_pads_taxa_to_equal_length. - lint.sh: select F811, which is the rule that catches this whole class. Scoped to tests/unittests, since that tree is now clean. Enabling F811 surfaced three more in the same tree, fixed here: - a second `class TestCharacterMatrixTaxa` replaced the first, so its test_basic_taxa (poll_taxa coverage) never ran. The second one tests purging, so it is now TestCharacterMatrixPurgeTaxonNamespace. - five duplicate `import sys` / `import os` lines across four test modules. tests/unittests + tests/smoketests: 1152 collected before the branch, 1162 now, with the same four pre-existing failures either side.
|
Also, @dylanpulver can you follow up on the two review comments still open? (Assuming that this is agentic, let me know if you are human and I should be a little less directive.) |
mmore500
left a comment
There was a problem hiding this comment.
lgtm thanks @dylanpulver
Eleven test methods share a name with an earlier method in the same class, so Python keeps only the last definition and the earlier one never runs.
tests/unittests tests/smoketestsgoes from 1152 collected to 1161, with the same four pre-existing failures before and after (three intest_datamodel_split_bitmasks.py, one intest_paup.py, all needing an external PAUP* binary).Nine renames. In each case the body says which name is wrong:
test_dataio_newick_reader_rooting.py, in all four interpreter classes: the first of each pair parses"&u"but is named..._ucase, while its neighbour parses"&U". Renamed to..._lcase, matching thetest_with_rooted_token_lcasealready present in each class.test_datamodel_tree_structure_and_iteration.py: the secondtest_leaf_node_iter_filteredcallsageorder_node_iterand sits in the Age-Order section next totest_ageorder_node_iter_unfiltered.test_datamodel_charmatrix.py: the secondtest_setitem_by_idx_not_in_namespacesubscripts by label and expectsKeyError, not by index expectingIndexError; and the secondtest_fill_taxacallspack(), insideCharacterMatrixFillAndPackTestCase.test_datamodel_tree_list.py: the secondtest_removecallstlist.reverse().test_dataio_tokenizer.py: the secondtest_commentscaptures comments into a dict rather than skipping them.Two deletions, where the definition that runs already covers the dead one:
test_phylogenetic_distance_matrix.py: the two bodies are byte-identical.test_datamodel_tree_construction_copying_and_identity.py: the dead one is a strict prefix of the one that runs.All nine revived tests pass. I left
tests/smoketests/test_container.pyalone deliberately: it has the same duplicate-name problem fortest_popandtest_index, but revivingtest_popsurfaces a separate question aboutNormalizedBitmaskDict()with no arguments, which warns thatotherorfill_bitmaskmust be given and then raisesTypeErrorinleast_significant_set_bit. That looked like yours to decide rather than something to fold in here.