Skip to content

Commit

Permalink
tox.ini: introduce a xenial-dev testenv, executed by default
Browse files Browse the repository at this point in the history
This environment is identical to [testenv:xenial], but uses the earliest
version of pytest that works with Python 3.8.
  • Loading branch information
OddBloke committed Feb 25, 2020
1 parent 01843fd commit 8affaf2
Showing 1 changed file with 28 additions and 7 deletions.
35 changes: 28 additions & 7 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py3, xenial, pycodestyle, pyflakes, pylint
envlist = py3, xenial-dev, pycodestyle, pyflakes, pylint
recreate = True

[testenv]
Expand Down Expand Up @@ -55,11 +55,15 @@ commands =
{envpython} -m sphinx {posargs:doc/rtd doc/rtd_html}
doc8 doc/rtd

[testenv:xenial]
commands =
python ./tools/pipremove jsonschema
python -m pytest {posargs:tests/unittests cloudinit}
basepython = python3
[xenial-shared-deps]
# The version of pytest in xenial doesn't work with Python 3.8, so we define
# two xenial environments: [testenv:xenial] runs the tests with exactly the
# version of pytest present in xenial, and is used in CI. [testenv:xenial-dev]
# runs the tests with the lowest version of pytest that works with Python 3.8,
# 3.0.7, but keeps the other dependencies at xenial's level.
#
# (This section is not a testenv, it is used to maintain a single definition of
# the dependencies shared between the two xenial testenvs.)
deps =
# requirements
jinja2==2.8
Expand All @@ -76,10 +80,27 @@ deps =
# test-requirements
httpretty==0.9.6
mock==1.3.0
pytest==2.8.7
unittest2==1.1.0
contextlib2==0.5.1

[testenv:xenial]
commands =
python ./tools/pipremove jsonschema
python -m pytest {posargs:tests/unittests cloudinit}
basepython = python3
deps =
# Refer to the comment in [xenial-shared-deps] for details
{[xenial-shared-deps]deps}
pytest==2.8.7

[testenv:xenial-dev]
commands = {[testenv:xenial]commands}
basepython = {[testenv:xenial]basepython}
deps =
# Refer to the comment in [xenial-shared-deps] for details
{[xenial-shared-deps]deps}
pytest==3.0.7

[testenv:tip-pycodestyle]
commands = {envpython} -m pycodestyle {posargs:cloudinit/ tests/ tools/}
deps = pycodestyle
Expand Down

0 comments on commit 8affaf2

Please sign in to comment.