Skip to content

Commit ef2a124

Browse files
authored
Merge pull request #15 from DenverCoder1/tox
ci: Test with tox command
2 parents b8d4034 + d5dc498 commit ef2a124

File tree

3 files changed

+8
-16
lines changed

3 files changed

+8
-16
lines changed

.github/workflows/python-app.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ jobs:
2525
- name: Install dependencies
2626
run: |
2727
python -m pip install --upgrade pip
28-
pip install flake8==3.8.4 pytest
28+
pip install flake8==3.8.4 pytest tox
2929
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
3030
- name: Lint with flake8
3131
run: |
3232
python setup.py lint
3333
- name: Test with pytest
3434
run: |
35-
python setup.py test
35+
tox

setup.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,6 @@
44
from setuptools.command.test import test as TestCommand, Command
55

66

7-
class PyTest(TestCommand):
8-
def finalize_options(self):
9-
TestCommand.finalize_options(self)
10-
self.test_args = ["tests", "-s"]
11-
self.test_suite = True
12-
13-
def run_tests(self):
14-
import pytest
15-
16-
errno = pytest.main(self.test_args)
17-
raise SystemExit(errno)
18-
19-
207
class LintCommand(Command):
218
"""
229
A copy of flake8's Flake8Command
@@ -96,7 +83,6 @@ def requirements():
9683
"pytest>=6.2,<7",
9784
],
9885
cmdclass={
99-
"test": PyTest,
10086
"lint": LintCommand,
10187
},
10288
)

tox.ini

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[tox]
2+
envlist = python3.9
3+
4+
[testenv]
5+
deps = pytest
6+
commands = pytest tests -s

0 commit comments

Comments
 (0)