Tests that a solution can be serialised and unserialised.
(ok_small)
| 776 | |
| 777 | |
| 778 | def 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( |
nothing calls this directly
no test coverage detected