text: import logging
  import pytest
  from aoc_wim.aoc2019 import q10
  
  
  maps = """\
  .#..#
  .....
  #####
  ....#
  ...##
  
  ......#.#.
  #..#.#....
  ..#######.
  .#.#.###..
  .#..#.....
  ..#....#.#
  #..#....#.
  .##.#..###
  ##...#..#.
  .#....####
  
  #.#...#.#.
  .###....#.
  .#....#...
  ##.#.#.#.#
  ....#.#.#.
  .##..###.#
  ..#...##..
  ..##....##
  ......#...
  .####.###.
  
  .#..#..###
  ####.###.#
  ....###.#.
  ..###.##.#
  ##.##.#.#.
  ....###..#
  ..#.#..#.#
  #..#.#.###
  .##...##.#
  .....#.#..
  
  .#..##.###...#######
  ##.############..##.
  .#.######.########.#
  .###.#######.####.#.
  #####.##.#.##.###.##
  ..#####..#.#########
  ####################
  #.####....###.#.#.##
  ##.#################
  #####.##.###..####..
  ..######..##.#######
  ####.##.####...##..#
  .#####..#.######.###
  ##...#.##########...
  #.##########.#######
  .####.#.###.###.#.##
  ....##.##.###..#####
  .#.#.###########.###
  #.#.#.#####.####.###
  ###.##.####.##.#..##
  """.split("\n\n")
  
  pos = [(3, 4), (5, 8), (1, 2), (6, 3), (11, 13)]
  
  
  @pytest.mark.parametrize("i, expected_pos", enumerate(pos))
  def test_best_monitoring_station_position(i, expected_pos):
      data = maps[i]
      pos, n = q10.best_monitoring_station(data)
      assert pos == expected_pos
  
  
  extra = """\
  The 1st asteroid to be vaporized is at 11,12.
  The 2nd asteroid to be vaporized is at 12,1.
  The 3rd asteroid to be vaporized is at 12,2.
  The 10th asteroid to be vaporized is at 12,8.
  The 20th asteroid to be vaporized is at 16,0.
  The 50th asteroid to be vaporized is at 16,9.
  The 100th asteroid to be vaporized is at 10,16.
  The 199th asteroid to be vaporized is at 9,6.
  The 200th asteroid to be vaporized is at 8,2.
  The 201st asteroid to be vaporized is at 10,9.
  The 299th and final asteroid to be vaporized is at 11,1."""
  
  
  def test_logs(caplog):
      with caplog.at_level(logging.INFO):
          q10.part_ab(data=maps[-1], target=300)
      messages = [message for _name, _level, message in caplog.record_tuples]
      for line in extra.splitlines():
          assert line in messages
  