Skip to content

Commit 12eca85

Browse files
authored
fix: Run pytest directly. "setup.py test" was removed in setuptools 72. (#172)
1 parent 29da916 commit 12eca85

File tree

3 files changed

+20
-17
lines changed

3 files changed

+20
-17
lines changed

.github/workflows/ci.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,11 @@ jobs:
2727
- name: Install warcio
2828
run: python setup.py install
2929

30+
- name: Install test dependencies
31+
run: pip install -e ".[testing]"
32+
3033
- name: Run tests
31-
run: python setup.py test
34+
run: python -m pytest
3235

3336
- name: Upload coverage to Codecov
3437
uses: codecov/codecov-action@v1

pytest.ini

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[pytest]
2+
addopts = -v --cov warcio --doctest-modules
3+
testpaths =
4+
warcio
5+
test

setup.py

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,6 @@ def finalize_options(self):
1414
# should work with setuptools <18, 18 18.5
1515
self.test_suite = ' '
1616

17-
def run_tests(self):
18-
import pytest
19-
import sys
20-
import os
21-
errcode = pytest.main(['--doctest-modules', './warcio', '--cov', 'warcio', '-v', 'test/'])
22-
sys.exit(errcode)
23-
2417
setup(
2518
name='warcio',
2619
version=__version__,
@@ -44,15 +37,17 @@ def run_tests(self):
4437
""",
4538
cmdclass={'test': PyTest},
4639
test_suite='',
47-
tests_require=[
48-
'urllib3==1.25.11',
49-
'pytest',
50-
'pytest-cov',
51-
'httpbin>=0.10.2',
52-
'requests',
53-
'wsgiprox',
54-
'hookdns',
55-
],
40+
extras_require={
41+
'testing': [
42+
'urllib3==1.25.11',
43+
'pytest',
44+
'pytest-cov',
45+
'httpbin>=0.10.2',
46+
'requests',
47+
'wsgiprox',
48+
'hookdns',
49+
]
50+
},
5651
classifiers=[
5752
'Development Status :: 5 - Production/Stable',
5853
'Environment :: Web Environment',

0 commit comments

Comments
 (0)