box-o-sand/aoc2020/day06/test_solution.py

24 lines
458 B
Python

import sys
from pathlib import Path
import pytest
from solution import main
HERE = Path(__file__).absolute().parent
def test_solution(capsys):
with (HERE / "test-input").open() as infile:
sys.stdin = infile
main()
expected_output = (HERE / "test-output").read_text().splitlines()
assert expected_output == [
l
for l in capsys.readouterr().out.splitlines()
if not l.startswith("highest_seat")
]