You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
436 B
22 lines
436 B
4 years ago
|
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 == [
|
||
4 years ago
|
l for l in capsys.readouterr().out.splitlines() if l.startswith("counts_sum")
|
||
4 years ago
|
]
|