MCPcopy Create free account
hub / github.com/PyVRP/PyVRP / test_solution_can_be_pickled

Function test_solution_can_be_pickled

tests/test_Solution.py:778–788  ·  view source on GitHub ↗

Tests that a solution can be serialised and unserialised.

(ok_small)

Source from the content-addressed store, hash-verified

776
777
778def test_solution_can_be_pickled(ok_small):
779 """
780 Tests that a solution can be serialised and unserialised.
781 """
782 rng = RandomNumberGenerator(seed=2)
783
784 before_pickle = Solution.make_random(ok_small, rng)
785 bytes = pickle.dumps(before_pickle)
786 after_pickle = pickle.loads(bytes)
787
788 assert_equal(after_pickle, before_pickle)
789
790
791@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected