diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 0000000..244652d --- /dev/null +++ b/.coveragerc @@ -0,0 +1,17 @@ +[report] +# Regexes for lines to exclude from consideration +exclude_lines = + # Have to re-enable the standard pragma + pragma: no cover + + # Don't complain about missing debug-only code: + def __repr__ + + # Don't complain if tests don't hit defensive assertion code: + raise AssertionError + raise NotImplementedError + raise exceptions.NotSupportedError + + # TYPE_CHECKING and @overload blocks are never executed during pytest run + if TYPE_CHECKING: + @overload diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index efbbc18..5ddc9ed 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -86,7 +86,7 @@ jobs: - run: mypy aioesphomeapi name: Check typing with mypy if: ${{ matrix.python-version == '3.11' && matrix.extension == 'skip_cython' }} - - run: pytest -vv --cov --cov-report=xml --tb=native tests + - run: pytest -vv --cov=aioesphomeapi --cov-report=xml --tb=native tests name: Run tests with pytest - name: Upload coverage to Codecov uses: codecov/codecov-action@v3