Skip to content

Commit cd481ac

Browse files
committed
Fix tests to include the year of the challenge
1 parent f6d9e58 commit cd481ac

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
1313
- Fixed typing in cli module
1414
- Adapt ruff config for a newer version
1515
- Fix day template to consider also the year of the challenge
16+
- Fix tests to include the year of the challenge
1617

1718
### Changed
1819
- Update repository to the newest cookiecutter template

src/aoc/base_tests.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,30 +42,34 @@ def test_on_sample_data_part_1(self):
4242
pytest.skip("No expected result for part one of test data set.")
4343

4444
challenge = self.challenge_class(
45-
SmartFileInputProvider(self.challenge_class.day, use_test_data=True)
45+
SmartFileInputProvider(
46+
self.challenge_class.year, self.challenge_class.day, use_test_data=True
47+
)
4648
)
4749
assert challenge.part_1(challenge.get_input_lines(part=1)) == expected_result
4850

4951
def test_on_sample_data_part_2(self):
5052
if (expected_result := self.expected_results_from_test_data[1]) == Empty:
5153
pytest.skip("No expected results for part two of test data set.")
5254
challenge = self.challenge_class(
53-
SmartFileInputProvider(self.challenge_class.day, use_test_data=True)
55+
SmartFileInputProvider(
56+
self.challenge_class.year, self.challenge_class.day, use_test_data=True
57+
)
5458
)
5559
assert challenge.part_2(challenge.get_input_lines(part=2)) == expected_result
5660

5761
def test_on_real_data_part_1(self):
5862
if (expected_result := self.expected_results_from_real_data[0]) == Empty:
5963
pytest.skip("No expected result for part one of real data set.")
6064
challenge = self.challenge_class(
61-
SmartFileInputProvider(self.challenge_class.day)
65+
SmartFileInputProvider(self.challenge_class.year, self.challenge_class.day)
6266
)
6367
assert challenge.part_1(challenge.get_input_lines(part=1)) == expected_result
6468

6569
def test_on_real_data_part_2(self):
6670
if (expected_result := self.expected_results_from_real_data[1]) == Empty:
6771
pytest.skip("No expected results for part two of real data set.")
6872
challenge = self.challenge_class(
69-
SmartFileInputProvider(self.challenge_class.day)
73+
SmartFileInputProvider(self.challenge_class.year, self.challenge_class.day)
7074
)
7175
assert challenge.part_2(challenge.get_input_lines(part=2)) == expected_result

0 commit comments

Comments
 (0)