Skip to content

[EXPERIMENTAL] Fix test_graph.py tests#4569

Merged
chopan050 merged 7 commits intoManimCommunity:experimentalfrom
fmuenkel:fix_graph_tests
Feb 19, 2026
Merged

[EXPERIMENTAL] Fix test_graph.py tests#4569
chopan050 merged 7 commits intoManimCommunity:experimentalfrom
fmuenkel:fix_graph_tests

Conversation

@fmuenkel
Copy link
Contributor

@fmuenkel fmuenkel commented Feb 3, 2026

Overview: What does this pull request change?

Currently a lot of tests in test_graph.py fail, because __str__() is missing from Graph and DiGraph.
This PR

  • adds __str__() wrapping around __repr__()
  • uses numpy's assert_allclose() to make two more test pass
  • fixes a bug in graph.py's GenericGraph._add_vertices_animation() where not all temporary vertices were removed from the scenebuffer after the animation.

Now all tests in test_graph.py pass.

Motivation and Explanation: Why and how do your changes improve the library?

Links to added or changed documentation pages

Further Information and Comments

Reviewer Checklist

  • The PR title is descriptive enough for the changelog, and the PR is labeled correctly
  • If applicable: newly added non-private functions and classes have a docstring including a short summary and a PARAMETERS section
  • If applicable: newly added functions and classes are tested

@fmuenkel fmuenkel marked this pull request as ready for review February 4, 2026 09:13
Copy link
Contributor

@chopan050 chopan050 left a comment

Choose a reason for hiding this comment

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

Thanks! I left some comments:

Copy link
Contributor

@chopan050 chopan050 left a comment

Choose a reason for hiding this comment

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

LGTM! See my latest comment for more information on what's going on in GenericGraph._add_vertices_animation() in the end.

@chopan050 chopan050 merged commit 8b24a43 into ManimCommunity:experimental Feb 19, 2026
0 of 2 checks passed
@chopan050 chopan050 changed the title [EXPERIMENTAL] Fix some graph tests [EXPERIMENTAL] Fix test_graph.py tests Feb 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments