Language: Python
Advent of Code is an Advent calendar of small programming puzzles for a variety of skill sets and skill levels that can be solved in any programming language you like. People use them as a speed contest, interview prep, company training, university coursework, practice problems, or to challenge each other.
You don't need a computer science background to participate - just a little programming knowledge and some problem solving skills will get you pretty far. Nor do you need a fancy computer; every problem has a solution that completes in at most 15 seconds on ten-year-old hardware.
Source: Advent of Code Github Topic
Day 01
Day 02
Day 03
Day 04
Day 05
Day 06
Day 07
Day 08
Day 09
Day 10
Day 11
Day 12
Keywords: aoc adventofcode
- uv init .
- uv tool install ruff
-
uv run pytest
-
uv run pytest tests/test_name_of_test.py
-
constraints for test
- Write a pytest test suite following these specific rules.
- Never use f-strings directly as arguments to error constructors like pytest.fail().
- F-strings are permitted when assigned to variables first, then passed to error constructors.
- Use type hints where appropriate throughout the code.
- Only use built-in type hinting (no imports from typing module). Exceptions require explicit approval.
- Absolutely no assert statements - use pytest.fail() with error messages instead.
- All test method docstrings must have their first line ending with a period.
- Pay special attention to f-string usage (rules 2-3) and type hinting restrictions (rules 4-5).
- Use a test class structure with fixtures as shown in the example.
```python from my_class_module import Solution class MyTestClass: @pytest.fixture def solution(self) -> Solution: """Return a Solution instance for testing.""" return Solution() ```- The method being tested must literally be named function_under_test when called.
```python def my_test_1(self, solution: Solution) -> None solution.function_under_test() ```- Import the Solution class from "my_class_module" as specified.