diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 902aa049..56f8074e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -58,7 +58,8 @@ jobs: python-version: ${{ matrix.python-version }} - name: Run unit tests run: | - python3 -m pytest tests/unit + python3 -m pytest --cov=custom_components.octopus_energy tests/unit + integration_tests: # Tests are geared towards my account, so ignore for others if: ${{ github.repository_owner == 'BottlecapDave' && github.repository_owner == github.actor }} @@ -81,7 +82,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Run integration tests run: | - python3 -m pytest tests/integration + python3 -m pytest --cov=custom_components.octopus_energy --cov-append tests/integration env: API_KEY: ${{ secrets.OCTOPUS_ENERGY_API_TOKEN }} GAS_MPRN: ${{ secrets.OCTOPUS_ENERGY_GAS_MPRN }} diff --git a/requirements.test.txt b/requirements.test.txt index b22f4af1..a25a53a0 100644 --- a/requirements.test.txt +++ b/requirements.test.txt @@ -1,10 +1,11 @@ pytest pytest-socket pytest-asyncio +pytest-cov mock homeassistant pydantic psutil-home-assistant sqlalchemy fnvhash -fnv_hash_fast \ No newline at end of file +fnv_hash_fast