From 39dd868a3458171955e71d0687e84866c7017add Mon Sep 17 00:00:00 2001 From: aeon0 Date: Wed, 12 Jan 2022 19:52:26 +0100 Subject: [PATCH] Fix testing (#437) * test * with coverage * add back coverage * actually fixing test * ups typo --- .github/workflows/ci.yml | 4 ++++ test/game_stats_test.py | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6be2e47..0dba9c9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,6 +45,10 @@ jobs: C:\Miniconda\condabin\conda.bat activate botty python -c "import sys; print(sys.version)" coverage run --source=./src -m pytest -v -s + - name: Coverage Report Generation + shell: powershell + run: | + C:\Miniconda\condabin\conda.bat activate botty coverage xml - name: Upload Coverage to Codecov uses: codecov/codecov-action@v2 diff --git a/test/game_stats_test.py b/test/game_stats_test.py index 32a6b25..a5f1160 100644 --- a/test/game_stats_test.py +++ b/test/game_stats_test.py @@ -1,4 +1,5 @@ import pytest +import numpy as np from logger import Logger from game_stats import GameStats @@ -19,7 +20,7 @@ class TestGameStats: def test_log_item_keep(self, item_name: str, item_should_be_added: bool): self.game_stats.update_location("test_location") previous_item_count = len(self.game_stats._location_stats["test_location"]["items"]) - self.game_stats.log_item_keep(item_name, send_message=False) + self.game_stats.log_item_keep(item_name, send_message=False, img=np.zeros([5, 5])) new_item_count = len(self.game_stats._location_stats["test_location"]["items"]) item_was_added = previous_item_count < new_item_count assert(item_was_added == item_should_be_added)