Skip to content

Commit

Permalink
Add code coverage commentator (#109)
Browse files Browse the repository at this point in the history
* Added code coverage

* Removed arguments from pytest.ini

* Try to install pytest-cov

* Changed way of installing test dependencies
  • Loading branch information
kkapka committed Jul 19, 2021
1 parent def8fa3 commit 9514d42
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[run]
omit = sklift/tests/*,*__init__.py*
6 changes: 4 additions & 2 deletions .github/workflows/ci-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies and lints
run: pip install pytest .[tests]
run: pip install . -r test_requirements.txt -r requirements.txt
- name: Run PyTest
run: pytest
run: pytest | tee pytest-coverage.txt
- name: Comment coverage
uses: coroo/pytest-coverage-commentator@v1.0.2

check_sphinx_build:
name: Check Sphinx build for docs
Expand Down
2 changes: 2 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[pytest]
addopts = --cov-report html --cov-report xml --cov-report term --cov-config=.coveragerc --cov=sklift
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
import re
import sys
from shutil import rmtree
import re

from setuptools import Command, find_packages, setup

Expand All @@ -14,7 +14,7 @@

here = os.path.abspath(os.path.dirname(__file__))

with open(os.path.join(here, 'Readme.rst')) as f:
with open(os.path.join(here, 'Readme.rst'), encoding="utf-8") as f:
LONG_DESCRIPTION = f.read()

# What packages are required for this module to be executed?
Expand All @@ -25,7 +25,7 @@
REQUIRED = []

# What packages are optional?
EXTRAS = {"test": ["pytest"]}
EXTRAS = {"test": ["pytest", "pytest-cov"]}


def get_version():
Expand Down
2 changes: 2 additions & 0 deletions test_requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pytest
pytest-cov

0 comments on commit 9514d42

Please sign in to comment.