Skip to content

Commit

Permalink
2015: Use pytest
Browse files Browse the repository at this point in the history
  • Loading branch information
jp7677 committed Dec 15, 2024
1 parent 730206a commit cabbb57
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 34 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,14 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run AoC 2015
run: |
cd 2015
python -m unittest *.py
pytest
AoC-2017:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion 2015/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ Only Linux has been tested. Other platforms might just work though.
## Compile & run

```bash
python -m unittest *.py
pytest
```
14 changes: 0 additions & 14 deletions 2015/day00.py

This file was deleted.

18 changes: 0 additions & 18 deletions 2015/day01.py

This file was deleted.

1 change: 1 addition & 0 deletions 2015/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pytest==8.3.4
7 changes: 7 additions & 0 deletions 2015/test_day00.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from util import read_input


def test_part01():
input_data = read_input("day00-input.txt")

assert input_data == '0'
11 changes: 11 additions & 0 deletions 2015/test_day01.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from util import read_input


def test_part01():
input_data = read_input("day01-input.txt")

up = input_data.count(')')
down = input_data.count('(')
floor = abs(up - down)

assert floor == 138

0 comments on commit cabbb57

Please sign in to comment.