mirror of
https://github.com/Noettore/AdventOfCode.git
synced 2025-10-15 03:36:39 +02:00
AoC 2020: day6 and day7, added day_# to test function names
Signed-off-by: Ettore Dreucci <ettore.dreucci@gmail.com>
This commit is contained in:
@@ -49,13 +49,13 @@ def part2(entries: list) -> int:
|
|||||||
count += 1
|
count += 1
|
||||||
return count
|
return count
|
||||||
|
|
||||||
def test_input():
|
def test_input_day_6():
|
||||||
"""pytest testing function"""
|
"""pytest testing function"""
|
||||||
entries = extract(TEST_INPUT)
|
entries = extract(TEST_INPUT)
|
||||||
assert part1(entries) == 11
|
assert part1(entries) == 11
|
||||||
assert part2(entries) == 6
|
assert part2(entries) == 6
|
||||||
|
|
||||||
def test_bench(benchmark):
|
def test_bench_day_6(benchmark):
|
||||||
"""pytest-benchmark function"""
|
"""pytest-benchmark function"""
|
||||||
benchmark(main)
|
benchmark(main)
|
||||||
|
|
||||||
|
@@ -75,18 +75,16 @@ def part2(graph: dict, color: str) -> int:
|
|||||||
return count
|
return count
|
||||||
return search_count(graph, color)-1
|
return search_count(graph, color)-1
|
||||||
|
|
||||||
def test_input():
|
def test_input_day_7():
|
||||||
"""pytest testing function"""
|
"""pytest testing function"""
|
||||||
graph, reverse_graph = extract(TEST_INPUT)
|
graph, reverse_graph = extract(TEST_INPUT)
|
||||||
assert part1(reverse_graph, "shiny gold") == 4
|
assert part1(reverse_graph, "shiny gold") == 4
|
||||||
assert part2(graph, "shiny gold") == 32
|
assert part2(graph, "shiny gold") == 32
|
||||||
|
|
||||||
def test_input_2():
|
|
||||||
"""pytest testing function"""
|
|
||||||
graph, _ = extract(TEST_INPUT_2)
|
graph, _ = extract(TEST_INPUT_2)
|
||||||
assert part2(graph, "shiny gold") == 126
|
assert part2(graph, "shiny gold") == 126
|
||||||
|
|
||||||
def test_bench(benchmark):
|
def test_bench_day_7(benchmark):
|
||||||
"""pytest-benchmark function"""
|
"""pytest-benchmark function"""
|
||||||
benchmark(main)
|
benchmark(main)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user