Skip to content

Commit

Permalink
test: add reason to pytest skipif conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelblijleven committed Dec 6, 2023
1 parent 4af2425 commit 831963a
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions tests/adventofcode/year_2015/test_day_02_2015.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ def test_parse_line():
assert str(wrapped_e.value) == "could not parse line"


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


@pytest.mark.skipif(os.environ["CI"] == "true")
@pytest.mark.skipif(os.environ["CI"] == "true", reason="inputs not available in CI")
def test_part_two():
assert part_two(get_input_for_day(2015, 2)) == 3842356
4 changes: 2 additions & 2 deletions tests/adventofcode/year_2015/test_day_10_2015.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def test_iterate(value, expected):
assert expected == iterate(value)


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

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


@pytest.mark.skipif(os.environ["CI"] == "true")
@pytest.mark.skipif(os.environ["CI"] == "true", reason="inputs not available in CI")
def test_part_two_method_2():
assert part_two_method_2(get_input_for_day(2015, 10)) == 4666278
4 changes: 2 additions & 2 deletions tests/adventofcode/year_2015/test_day_19_2015.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
from adventofcode.year_2015.day_19_2015 import get_input_for_day, part_one, part_two


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


@pytest.mark.skipif(os.environ["CI"] == "true")
@pytest.mark.skipif(os.environ["CI"] == "true", reason="inputs not available in CI")
def test_part_two():
assert part_two(get_input_for_day(2015, 19)) == 200
4 changes: 2 additions & 2 deletions tests/adventofcode/year_2015/test_day_23_2015.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
)


@pytest.mark.skipif(os.environ["CI"] == "true")
@pytest.mark.skipif(os.environ["CI"] == "true", reason="inputs not available in CI")
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")
@pytest.mark.skipif(os.environ["CI"] == "true", reason="inputs not available in CI")
def test_part_two():
assert run_program(get_input_for_day(2015, 23), {"a": 1, "b": 0}) == 334

Expand Down
4 changes: 2 additions & 2 deletions tests/adventofcode/year_2015/test_day_24_2015.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ def test_move_packages_into_groups():
assert move_packages_into_groups(test_input, 4) == 44


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


@pytest.mark.skipif(os.environ["CI"] == "true")
@pytest.mark.skipif(os.environ["CI"] == "true", reason="inputs not available in CI")
def test_part_two():
assert part_two(get_input_for_day(2015, 24)) == 74850409
4 changes: 2 additions & 2 deletions tests/adventofcode/year_2015/test_day_25_2015.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
from adventofcode.year_2015.day_25_2015 import part_one, part_two


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


@pytest.mark.skipif(os.environ["CI"] == "true")
@pytest.mark.skipif(os.environ["CI"] == "true", reason="inputs not available in CI")
def test_part_two():
assert part_two(get_input_for_day(2015, 25)) == "hooray"
4 changes: 2 additions & 2 deletions tests/adventofcode/year_2021/test_day_02_2021.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ def test_get_new_position():
assert str(wrapped_e.value) == "unknown direction received: coffee"


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


@pytest.mark.skipif(os.environ["CI"] == "true")
@pytest.mark.skipif(os.environ["CI"] == "true", reason="inputs not available in CI")
def test_part_two():
answer = part_two(get_input_for_day(2021, 2))
assert answer == 2015547716
2 changes: 1 addition & 1 deletion tests/adventofcode/year_2021/test_day_13_2021.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def test_part_one():


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

0 comments on commit 831963a

Please sign in to comment.