Skip to content

Commit

Permalink
test: exclude tests that require inputs from running in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelblijleven committed Dec 6, 2023
1 parent edac32c commit 4af2425
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/adventofcode/year_2015/test_day_02_2015.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import os

import pytest

from adventofcode.year_2015.day_02_2015 import (
Expand Down Expand Up @@ -27,9 +29,11 @@ def test_parse_line():
assert str(wrapped_e.value) == "could not parse line"


@pytest.mark.skipif(os.environ["CI"] == "true")
def test_part_one():
assert part_one(get_input_for_day(2015, 2)) == 1606483


@pytest.mark.skipif(os.environ["CI"] == "true")
def test_part_two():
assert part_two(get_input_for_day(2015, 2)) == 3842356
4 changes: 4 additions & 0 deletions tests/adventofcode/year_2015/test_day_10_2015.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import os

import pytest

from adventofcode.util.input_helpers import get_input_for_day
Expand Down Expand Up @@ -25,6 +27,7 @@ def test_iterate(value, expected):
assert expected == iterate(value)


@pytest.mark.skipif(os.environ["CI"] == "true")
def test_part_one():
assert part_one(get_input_for_day(2015, 10)) == 329356

Expand All @@ -34,5 +37,6 @@ def test_part_two():
assert part_two(get_input_for_day(2015, 10)) == 4666278


@pytest.mark.skipif(os.environ["CI"] == "true")
def test_part_two_method_2():
assert part_two_method_2(get_input_for_day(2015, 10)) == 4666278
6 changes: 6 additions & 0 deletions tests/adventofcode/year_2015/test_day_19_2015.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
import os

import pytest

from adventofcode.year_2015.day_19_2015 import get_input_for_day, part_one, part_two


@pytest.mark.skipif(os.environ["CI"] == "true")
def test_part_one():
assert part_one(get_input_for_day(2015, 19)) == 518


@pytest.mark.skipif(os.environ["CI"] == "true")
def test_part_two():
assert part_two(get_input_for_day(2015, 19)) == 200
4 changes: 4 additions & 0 deletions tests/adventofcode/year_2015/test_day_23_2015.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import os

import pytest

from adventofcode.year_2015.day_23_2015 import (
Expand All @@ -7,10 +9,12 @@
)


@pytest.mark.skipif(os.environ["CI"] == "true")
def test_part_one():
assert run_program(get_input_for_day(2015, 23), {"a": 0, "b": 0}) == 255


@pytest.mark.skipif(os.environ["CI"] == "true")
def test_part_two():
assert run_program(get_input_for_day(2015, 23), {"a": 1, "b": 0}) == 334

Expand Down
4 changes: 4 additions & 0 deletions tests/adventofcode/year_2015/test_day_24_2015.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import os

import pytest

from adventofcode.util.input_helpers import get_input_for_day
Expand Down Expand Up @@ -34,9 +36,11 @@ def test_move_packages_into_groups():
assert move_packages_into_groups(test_input, 4) == 44


@pytest.mark.skipif(os.environ["CI"] == "true")
def test_part_one():
assert part_one(get_input_for_day(2015, 24)) == 10723906903


@pytest.mark.skipif(os.environ["CI"] == "true")
def test_part_two():
assert part_two(get_input_for_day(2015, 24)) == 74850409
6 changes: 6 additions & 0 deletions tests/adventofcode/year_2015/test_day_25_2015.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
import os

import pytest

from adventofcode.util.input_helpers import get_input_for_day
from adventofcode.year_2015.day_25_2015 import part_one, part_two


@pytest.mark.skipif(os.environ["CI"] == "true")
def test_part_one():
assert part_one(get_input_for_day(2015, 25)) == 2650453


@pytest.mark.skipif(os.environ["CI"] == "true")
def test_part_two():
assert part_two(get_input_for_day(2015, 25)) == "hooray"
4 changes: 4 additions & 0 deletions tests/adventofcode/year_2021/test_day_02_2021.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import os

import pytest

from adventofcode.util.input_helpers import get_input_for_day
Expand Down Expand Up @@ -35,11 +37,13 @@ def test_get_new_position():
assert str(wrapped_e.value) == "unknown direction received: coffee"


@pytest.mark.skipif(os.environ["CI"] == "true")
def test_part_one():
answer = part_one(get_input_for_day(2021, 2))
assert answer == 2036120


@pytest.mark.skipif(os.environ["CI"] == "true")
def test_part_two():
answer = part_two(get_input_for_day(2021, 2))
assert answer == 2015547716
3 changes: 3 additions & 0 deletions tests/adventofcode/year_2021/test_day_13_2021.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import os

import pytest

from adventofcode.util.input_helpers import get_input_for_day
Expand Down Expand Up @@ -107,6 +109,7 @@ def test_part_one():


# flake8: noqa
@pytest.mark.skipif(os.environ["CI"] == "true")
def test_part_two():
assert (
part_two(get_input_for_day(2021, 13))
Expand Down

0 comments on commit 4af2425

Please sign in to comment.