Specify testenv command for tox>=2.5
As of the tox 2.5.0 release, failure to specify a default commands key in the fallback testenv section of tox.ini instantly fails with "ERROR: Commands not specified. Please update relevant section of .../tox.ini". Copy the testenv.commands entry from the openstack/cookiecutter repo's template. While at it, copy the boilerplate placeholder test from the cookiecutter templates so that jobs don't freak out when they discover (and then run) no tests. Change-Id: Ifb8fcfbb6d76edd8c7dcf814a705ee7eff3a9819
This commit is contained in:
parent
11647ed384
commit
fba7102ae4
@ -1,4 +1,7 @@
|
|||||||
[DEFAULT]
|
[DEFAULT]
|
||||||
test_command=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} OS_LOG_CAPTURE=${OS_LOG_CAPTURE:-1} ${PYTHON:-python} -m subunit.run discover -t ./ tests $LISTOPT $IDOPTION
|
test_command=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \
|
||||||
|
OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \
|
||||||
|
OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-60} \
|
||||||
|
${PYTHON:-python} -m subunit.run discover -t ./ . $LISTOPT $IDOPTION
|
||||||
test_id_option=--load-list $IDFILE
|
test_id_option=--load-list $IDFILE
|
||||||
test_list_option=--list
|
test_list_option=--list
|
||||||
|
5
gerritlib/tests/base.py
Normal file
5
gerritlib/tests/base.py
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
import testtools
|
||||||
|
|
||||||
|
|
||||||
|
class TestCase(testtools.TestCase):
|
||||||
|
"Placeholder wrapper for the testtools.TestCase class."
|
28
gerritlib/tests/test_gerritlib.py
Normal file
28
gerritlib/tests/test_gerritlib.py
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||||
|
# not use this file except in compliance with the License. You may obtain
|
||||||
|
# a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||||
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
|
# License for the specific language governing permissions and limitations
|
||||||
|
# under the License.
|
||||||
|
|
||||||
|
"""
|
||||||
|
test_gerritlib
|
||||||
|
----------------------------------
|
||||||
|
|
||||||
|
Tests for `gerritlib` module.
|
||||||
|
"""
|
||||||
|
|
||||||
|
from gerritlib.tests import base
|
||||||
|
|
||||||
|
|
||||||
|
class TestGerritlib(base.TestCase):
|
||||||
|
|
||||||
|
def test_something(self):
|
||||||
|
pass
|
@ -2,3 +2,4 @@ hacking>=0.5.6,<0.11
|
|||||||
sphinx>=1.1.2,<1.2
|
sphinx>=1.1.2,<1.2
|
||||||
python-subunit
|
python-subunit
|
||||||
testrepository
|
testrepository
|
||||||
|
testtools
|
||||||
|
1
tox.ini
1
tox.ini
@ -4,6 +4,7 @@ skipdist = True
|
|||||||
envlist = pep8, py27, pypy, py33, py34
|
envlist = pep8, py27, pypy, py33, py34
|
||||||
|
|
||||||
[testenv]
|
[testenv]
|
||||||
|
commands = python setup.py test --slowest --testr-args='{posargs}'
|
||||||
setenv = VIRTUAL_ENV={envdir}
|
setenv = VIRTUAL_ENV={envdir}
|
||||||
usedevelop = True
|
usedevelop = True
|
||||||
install_command = pip install {opts} {packages}
|
install_command = pip install {opts} {packages}
|
||||||
|
Loading…
Reference in New Issue
Block a user