Skip to content

Commit f2005be

Browse files
authored
Merge pull request #218 from graingert/configure-pytest-cov
2 parents ecd23e2 + 344ea06 commit f2005be

File tree

4 files changed

+64
-23
lines changed

4 files changed

+64
-23
lines changed

.github/workflows/main.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,19 @@ jobs:
2525
with:
2626
python-version: ${{ matrix.python-version }}
2727

28+
- name: Get pip cache dir
29+
id: pip-cache
30+
run: |
31+
echo "::set-output name=dir::$(pip cache dir)"
32+
33+
- name: pip cache
34+
uses: actions/cache@v2
35+
with:
36+
path: ${{ steps.pip-cache.outputs.dir }}
37+
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.cfg') }}
38+
restore-keys: |
39+
${{ runner.os }}-pip-
40+
2841
- name: Install
2942
run: |
3043
pip install tox

setup.cfg

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ packages =
2121
libmodernize.fixes
2222
py_modules = modernize
2323
zip_safe = False
24-
tests_require = nose
2524
python_requires = ~=3.6
2625
install_requires = fissix
2726

@@ -33,6 +32,10 @@ console_scripts =
3332
[options.extras_require]
3433
docs =
3534
sphinx~=3.2
35+
test =
36+
pytest
37+
pytest-cov
38+
coverage>=5.3
3639

3740
[bdist_wheel]
3841
universal = 1
@@ -46,3 +49,49 @@ extend-ignore =
4649
[isort]
4750
profile = black
4851
add_imports=from __future__ import generator_stop
52+
53+
[tool:pytest]
54+
addopts =
55+
--strict-config
56+
--strict-markers
57+
--cov
58+
--cov-fail-under=91.53
59+
--cov-report=term-missing:skip-covered
60+
xfail_strict = True
61+
junit_family = xunit2
62+
filterwarnings =
63+
error
64+
65+
[coverage:run]
66+
branch = True
67+
source_pkgs =
68+
modernize
69+
libmodernize
70+
source =
71+
tests
72+
73+
[coverage:paths]
74+
source =
75+
.
76+
.tox/*/lib/*/site-packages/
77+
.tox\\*\\Lib\\site-packages\\
78+
79+
[tox:tox]
80+
envlist =
81+
py{36,37,38},lint
82+
83+
[testenv]
84+
extras = test
85+
commands = pytest {posargs}
86+
87+
[testenv:coveralls]
88+
passenv = GITHUB_*
89+
deps =
90+
coveralls
91+
coverage>=5.3
92+
commands = coveralls
93+
94+
[testenv:lint]
95+
deps = pre-commit
96+
commands = pre-commit run --all-files --show-diff-on-failure {posargs}
97+
skip_install = true

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
raise Exception("couldn't find version number")
1414
version = version_match.group(1)
1515

16-
setup(version=version, test_suite="nose.collector")
16+
setup(version=version)

tox.ini

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)