Repository: ASPP/pelita

Issue:
run_background_game breaks when layout= is passed
```
def test_run_background_game_with_layout():
    test_layout = (
    """ ##################
        #a#.  .  # .     #
        #b#####    #####x#
        #     . #  .  .#y#
        ################## """)
    result = utils.run_background_game(blue_move=stopping_player, red_move=stopping_player, layout=test_layout)
```

```
        if layout is None:
            layout_dict = generate_maze(rng=rng)
        else:
>           layout_dict = parse_layout(layout, food=food, bots=bots)
E           NameError: name 'food' is not defined

pelita/utils.py:104: NameError
```


Discussion:

Patch:
diff --git a/pelita/utils.py b/pelita/utils.py
index c5bdf54c..1f3bec36 100644
--- a/pelita/utils.py
+++ b/pelita/utils.py
@@ -104,7 +104,7 @@ def run_background_game(*, blue_move, red_move, layout=None, max_rounds=300, see
     if layout is None:
         layout_dict = generate_maze(rng=rng)
     else:
-        layout_dict = parse_layout(layout, food=food, bots=bots)
+        layout_dict = parse_layout(layout)
 
     game_state = run_game((blue_move, red_move), layout_dict=layout_dict,
                           max_rounds=max_rounds, rng=rng,


Test patch:
diff --git a/test/test_utils.py b/test/test_utils.py
index 10118cbc..a06bde11 100644
--- a/test/test_utils.py
+++ b/test/test_utils.py
@@ -112,6 +112,38 @@ def test_run_background_game():
         'draw': True
     }
 
+def test_run_background_game_with_layout():
+    test_layout = (
+    """ ##################
+        #a#.  .  # .     #
+        #b#####    #####x#
+        #     . #  .  .#y#
+        ################## """)
+    result = utils.run_background_game(blue_move=stopping_player, red_move=stopping_player, layout=test_layout)
+    assert result['walls'] == set(parse_layout(test_layout)['walls'])
+
+    result.pop('seed')
+    result.pop('walls')
+    result.pop('layout')
+    result.pop('blue_food')
+    result.pop('red_food')
+    assert result == {
+        'round': 300,
+        'blue_bots': [(1, 1), (1, 2)],
+        'red_bots': [(16, 2), (16, 3)],
+        'blue_score': 0,
+        'red_score': 0,
+        'blue_errors': {},
+        'red_errors': {},
+        'blue_deaths': [0, 0],
+        'red_deaths': [0, 0],
+        'blue_kills': [0, 0],
+        'red_kills': [0, 0],
+        'blue_wins': False,
+        'red_wins': False,
+        'draw': True
+    }
+
 
 def test_walls_to_graph():
     test_layout = (