def test_matches_to_string(self): class Match: def __init__(self, span): self._span = span def span(self): return self._span matches = [Match((1, 2)), Match((10, 11))] ps = PanScanner() matches_string = ps.matches_to_string(matches) self.assertEqual(matches_string, '(1, 2), (10, 11)')