diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 20c922cf496d3f850f66a511a0f29e4c35b6d89c..8072058bea72df6807791442d1d75b663b588536 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,7 +5,7 @@ pytest: - apt-get install -y python3-dev python3-pip graphviz graphviz-dev - pip install pytest - pip install . - - pytest --junitxml=report.xml + - coverage run -m pytest --junitxml=report.xml artifacts: when: always reports: diff --git a/setup.py b/setup.py index 658851b4e072e83add01ebbf22717eb837a7801a..6d4c0062a3f99e02ab593b47c7a3898046d2eaf9 100644 --- a/setup.py +++ b/setup.py @@ -32,6 +32,7 @@ requirements = [ test_requirements = [ "pytest>=3", + "coverage>=7.4.3", ] setup( diff --git a/tests/test_cooking_equipment.py b/tests/test_cooking_equipment.py index acb8af74708877bd5eee93fb6de5a36cf9396135..5bc9fa3bb4dc16a8464d7a2284d2cdbd9b0a67a5 100644 --- a/tests/test_cooking_equipment.py +++ b/tests/test_cooking_equipment.py @@ -1,6 +1,6 @@ import pytest -from overcooked_simulator.game_items import ItemInfo, CookingEquipment, Item, ItemType +from cooperative_cuisine.game_items import ItemInfo, CookingEquipment, Item, ItemType def test_can_combine_single_other_item(): @@ -61,12 +61,16 @@ def test_progress(): cooking_equipment = CookingEquipment( transitions={}, name="Pot", item_info=item_info ) - cooking_equipment.active_transition = {"seconds": 5.0, "result": "TestResult"} + result = Item(name="TestResult", item_info=None) + cooking_equipment.active_transition = { + "seconds": 5.0, + "result": result, + } from datetime import datetime, timedelta cooking_equipment.progress(passed_time=timedelta(seconds=5.0), now=datetime.now()) - assert cooking_equipment.content_list == ["TestResult"] + assert cooking_equipment.content_list == [result] def test_reset_content(): diff --git a/tests/test_item.py b/tests/test_item.py index 975264617189b17c85aa0d6bb659cf80bc618765..9b3cdb64deb08be2331a1570198dd14c6577b372 100644 --- a/tests/test_item.py +++ b/tests/test_item.py @@ -1,6 +1,6 @@ import pytest -from overcooked_simulator.game_items import ItemInfo, Item, ItemType +from cooperative_cuisine.game_items import ItemInfo, Item, ItemType @pytest.fixture