Skip to content

Commit

Permalink
Tweaking Python CI test setup and fixing path issues
Browse files Browse the repository at this point in the history
  • Loading branch information
onefastsnail committed Aug 11, 2024
1 parent 58a1dad commit 170cc9d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/2015.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,12 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: 3.12
cache: false

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
poetry install --with dev
poetry install
- name: Run tests
run: poetry run pytest
2 changes: 1 addition & 1 deletion 2015/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tool.poetry]
name = "2015"
version = "0.1.0"
description = ""
description = "Advent of Code"
authors = ["onefastsnail"]
readme = "README.md"

Expand Down
8 changes: 6 additions & 2 deletions 2015/solutions/day1/test_day.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from pathlib import Path

import pytest

from solutions.day1.solution import part_1, part_2
Expand All @@ -10,7 +12,8 @@ def test_part_1_examples(test_input, expected):


def test_part_1():
f = open("./input.txt", "r")
file_path = Path(__file__).resolve().parent / 'input.txt'
f = open(file_path, "r")

assert part_1(f.read()) == 232

Expand All @@ -21,6 +24,7 @@ def test_part_2_examples(test_input, expected):


def test_part_2():
f = open("./input.txt", "r")
file_path = Path(__file__).resolve().parent / 'input.txt'
f = open(file_path, "r")

assert part_2(f.read()) == 1783
8 changes: 6 additions & 2 deletions 2015/solutions/day2/test_day.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from pathlib import Path

import pytest

from solutions.day2.solution import part_1, part_2
Expand All @@ -9,7 +11,8 @@ def test_part_1_examples(test_input, expected):


def test_part_1():
f = open("./input.txt", "r")
file_path = Path(__file__).resolve().parent / 'input.txt'
f = open(file_path, "r")

assert part_1(f.read().splitlines()) == 1606483

Expand All @@ -20,6 +23,7 @@ def test_part_2_examples(test_input, expected):


def test_part_2():
f = open("./input.txt", "r")
file_path = Path(__file__).resolve().parent / 'input.txt'
f = open(file_path, "r")

assert part_2(f.read().splitlines()) == 3842356

0 comments on commit 170cc9d

Please sign in to comment.