File tree Expand file tree Collapse file tree 6 files changed +55
-0
lines changed Expand file tree Collapse file tree 6 files changed +55
-0
lines changed Original file line number Diff line number Diff line change 1+ # --- Day 0: Template ---
2+
3+ To be used as template for the other days.
Original file line number Diff line number Diff line change 1+ import os
2+ import sys
3+
4+ sys .path .append ("." )
5+
6+ from solutions import part1 , part2
7+
8+ from utils .inputs import get_inputs
9+ from utils .profiling import profile_run
10+
11+ if __name__ == "__main__" :
12+ input_path = f"{ os .path .dirname (os .path .realpath (__file__ ))} /input.txt"
13+ inputs = get_inputs (input_path )
14+
15+ profile_run ("Part 1" , lambda : part1 (inputs ))
16+ profile_run ("Part 2" , lambda : part2 (inputs ))
Original file line number Diff line number Diff line change 1+ def part1 (inputs : list [str ]) -> int :
2+ return 1
3+
4+
5+ def part2 (inputs : list [str ]) -> int :
6+ return 2
Original file line number Diff line number Diff line change 1+ import os
2+
3+ import pytest
4+ from solutions import part1 , part2
5+
6+ from utils .inputs import get_inputs
7+
8+ current_dir = os .path .dirname (os .path .realpath (__file__ ))
9+
10+ input = get_inputs (f"{ current_dir } /input.txt" )
11+ input_test = get_inputs (f"{ current_dir } /input_test.txt" )
12+
13+
14+ class TestPart1 :
15+ def test_with_test_data (self ):
16+ assert part1 (input_test ) == 1
17+
18+ @pytest .mark .skip (reason = "not implemented" )
19+ def test_with_real_data (self ):
20+ assert part1 (input ) == 1
21+
22+
23+ class TestPart2 :
24+ @pytest .mark .skip (reason = "not implemented" )
25+ def test_with_test_data (self ):
26+ assert part2 (input_test ) == 2
27+
28+ @pytest .mark .skip (reason = "not implemented" )
29+ def test_with_real_data (self ):
30+ assert part2 (input ) == 2
You can’t perform that action at this time.
0 commit comments