tests.sorting.test_toposort_general

tests.sorting.test_toposort_general#

Unit tests for topological sorts which work on all toposorting algorithms.

Quirks unique to specific algorithms (Kahns, DFS-based, etc) are tested in their own modules.

Functions

test_toposort_die_on_cycle(algo, ...)

Check that a contains-cycles error is raised when a graph contains a cycle.

test_toposort_die_on_unknown_backend(...)

Tests topological sort throws an appropriate error when the user selects a backend that doesn't exist.

test_toposort_empty(algo)

Verify expected behavior when passing in an empty graph (empty return).

test_toposort_ff_via(algo, graph_clrs09_22_8)

Check the filterfunc-traverse-via operator of the topological sorts works as intended.

test_toposort_ordering(algo, direction, ...)

Borderline smoke-test level check of topological sort correctness.