Skip to content

Commit 256c7c6

Browse files
authored
Merge pull request #589 from python-cmd2/vsts_tox
Azure Pipelines build for macOS now runs tox instead of pytest
2 parents 2cc1b90 + 2c26b78 commit 256c7c6

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

azure-pipelines.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,16 @@ jobs:
1616
matrix:
1717
Python34:
1818
python.version: '3.4'
19+
TOXENV: 'py34'
1920
Python35:
2021
python.version: '3.5'
22+
TOXENV: 'py35'
2123
Python36:
2224
python.version: '3.6'
25+
TOXENV: 'py36'
2326
Python37:
2427
python.version: '3.7'
28+
TOXENV: 'py37'
2529
# Increase the maxParallel value to simultaneously run the job for all versions in the matrix (max 10 for free open-source)
2630
maxParallel: 4
2731

@@ -34,17 +38,15 @@ jobs:
3438

3539
# Install dependencies - install specific PyPI packages with pip, including cmd2 dependencies
3640
- script: |
37-
python -m pip install --upgrade pip && pip3 install --upgrade setuptools gnureadline
38-
pip install -e .
41+
python -m pip install --upgrade pip && pip3 install --upgrade setuptools tox
3942
displayName: 'Upgrade pip and setuptools'
4043
continueOnError: false
4144
4245
# TODO: Consider adding a lint test to use pycodestyle, flake8, or pylint, to check code style conventions
4346
4447
# Test - test with pytest, collect coverage metrics with pytest-cov, and publish these metrics to codecov.io
4548
- script: |
46-
pip install pytest pytest-cov pytest-mock codecov mock
47-
py.test tests --cov --junitxml=junit/test-results.xml && codecov
49+
tox -e $(TOXENV)
4850
displayName: 'Run tests and code coverage'
4951
continueOnError: false
5052

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
":python_version<'3.5'": ['contextlib2', 'typing'],
7676
# Extra dependencies for running unit tests
7777
'test': ["argcomplete ; sys_platform!='win32'", # include argcomplete tests where available
78+
"gnureadline; sys_platform=='darwin'", # include gnureadline on macOS to ensure it is available in tox env
7879
"mock ; python_version<'3.6'", # for python 3.5 and earlier we need the third party mock module
7980
'codecov', 'pytest', 'pytest-cov', 'pytest-mock'],
8081
# development only dependencies: install with 'pip install -e .[dev]'

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ passenv = CI TRAVIS TRAVIS_* APPVEYOR*
99
setenv = PYTHONPATH={toxinidir}
1010
extras = test
1111
commands =
12-
py.test {posargs} --cov
12+
py.test {posargs} --cov --junitxml=junit/test-results.xml
1313
codecov
1414

1515
[testenv:docs]

0 commit comments

Comments
 (0)