Skip to content

Commit

Permalink
fix: Run pytest directly. "setup.py test" was removed in setuptools 7…
Browse files Browse the repository at this point in the history
  • Loading branch information
white-gecko authored Aug 21, 2024
1 parent 29da916 commit 12eca85
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 17 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,11 @@ jobs:
- name: Install warcio
run: python setup.py install

- name: Install test dependencies
run: pip install -e ".[testing]"

- name: Run tests
run: python setup.py test
run: python -m pytest

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
5 changes: 5 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[pytest]
addopts = -v --cov warcio --doctest-modules
testpaths =
warcio
test
27 changes: 11 additions & 16 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,6 @@ def finalize_options(self):
# should work with setuptools <18, 18 18.5
self.test_suite = ' '

def run_tests(self):
import pytest
import sys
import os
errcode = pytest.main(['--doctest-modules', './warcio', '--cov', 'warcio', '-v', 'test/'])
sys.exit(errcode)

setup(
name='warcio',
version=__version__,
Expand All @@ -44,15 +37,17 @@ def run_tests(self):
""",
cmdclass={'test': PyTest},
test_suite='',
tests_require=[
'urllib3==1.25.11',
'pytest',
'pytest-cov',
'httpbin>=0.10.2',
'requests',
'wsgiprox',
'hookdns',
],
extras_require={
'testing': [
'urllib3==1.25.11',
'pytest',
'pytest-cov',
'httpbin>=0.10.2',
'requests',
'wsgiprox',
'hookdns',
]
},
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Web Environment',
Expand Down

0 comments on commit 12eca85

Please sign in to comment.