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

Function test_eq

tests/test_Statistics.py:77–92  ·  view source on GitHub ↗

Tests the equality operator.

(ok_small, num_iterations: int)

Source from the content-addressed store, hash-verified

75
76@pytest.mark.parametrize("num_iterations", [0, 1, 10])
77def test_eq(ok_small, num_iterations: int):
78 """
79 Tests the equality operator.
80 """
81 sol = Solution(ok_small, [[1, 2], [3, 4]])
82 cost_eval = CostEvaluator([20], 6, 6)
83
84 stats = Statistics()
85 for _ in range(num_iterations): # populate the statistics object
86 stats.collect(sol, sol, sol, cost_eval)
87
88 assert_equal(stats, stats)
89 assert_(stats != "test")
90
91 if num_iterations > 0:
92 assert_(stats != Statistics())
93
94
95def test_more_eq(ok_small):

Callers

nothing calls this directly

Calls 4

collectMethod · 0.95
SolutionClass · 0.90
CostEvaluatorClass · 0.90
StatisticsClass · 0.90

Tested by

no test coverage detected