diff --git a/aoc/year2021/day04.py b/aoc/year2021/day04.py index 9c60f22..50c07c7 100644 --- a/aoc/year2021/day04.py +++ b/aoc/year2021/day04.py @@ -309,7 +309,7 @@ def parse_input(string: str) -> dict: this_board: BingoBoard | None = None for line in string.splitlines()[1:]: - logging.debug("Reading Row >>%s<<", line) + LOG.debug("Reading Row >>%s<<", line) if line == "": if this_board is not None: print(this_board.as_table()) @@ -384,7 +384,7 @@ def solve( data = parse_input(SAMPLE_INPUT) if DEBUG else parse_input(INPUT) REMAINING_BOARDS = len(data["boards"]) for draw in data["draws"]: - logging.info("Calling %2d", draw) + LOG.info("Calling %2d", draw) for board in data["boards"]: if not board.has_won(): try: @@ -394,11 +394,11 @@ def solve( REMAINING_BOARDS = sum( [not x.has_won() for x in data["boards"]] ) - logging.info( + LOG.info( "Got a Bingo on board %d", ex_board.board.board_id, ) - logging.info( + LOG.info( "%d boards remain in play", REMAINING_BOARDS, ) diff --git a/aoc/year2022/day05.py b/aoc/year2022/day05.py index 09b4ec1..2eec814 100644 --- a/aoc/year2022/day05.py +++ b/aoc/year2022/day05.py @@ -160,7 +160,7 @@ def solve( for line in puzzle.splitlines(): if not _runner: print(line) - if line == "" and len(stacks) and mode == "crates": + if line == "" and stacks and mode == "crates": mode = "instructions" continue if mode == "crates": diff --git a/aoc/year2024/day01.py b/aoc/year2024/day01.py index 4d20373..42bfd90 100644 --- a/aoc/year2024/day01.py +++ b/aoc/year2024/day01.py @@ -151,7 +151,7 @@ def solve( result = 0 if part == "a": - while len(left): + while left: left_location = min(left) left.remove(left_location) right_location = min(right) diff --git a/tests/conftest.py b/tests/conftest.py index 91ae261..5fd0a9c 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -16,6 +16,8 @@ if TYPE_CHECKING: from collections.abc import Callable +LOG = logging.getLogger() + def pytest_terminal_summary( terminalreporter: TerminalReporter, @@ -115,7 +117,7 @@ def pytest_generate_tests(metafunc: pytest.Metafunc) -> None: if not f.is_dir() and f.stem.startswith("day") ][-1] ] - logging.info("Today's test is Year %s, Day %s", years[0], days[0]) + LOG.info("Today's test is Year %s, Day %s", years[0], days[0]) # This is a list of tuples. # Each Tuple consist of: