def test_sunset(self, stdout): locations = NumberedPoints(['52.015;-0.221', '52.168;0.040']) locations.sun_events('sunset') lines = stdout.getvalue().splitlines() expect(ellipsis_match('Sunset at ... in location 1', lines[0])) \ == True expect(ellipsis_match('Sunset at ... in location 2', lines[1])) \ == True
def test_sunset(self, capsys): locations = NumberedPoints(['52.015;-0.221', '52.168;0.040']) locations.sun_events('sunset') lines = capsys.readouterr()[0].splitlines() assert ellipsis_match('Sunset at ... in location 1', lines[0]) \ == True assert ellipsis_match('Sunset at ... in location 2', lines[1]) \ == True