Merge "Remove testr entry point"
This commit is contained in:
commit
f377238903
|
@ -390,6 +390,53 @@ environment, you can use::
|
||||||
testing =
|
testing =
|
||||||
quux:python_version=='2.7'
|
quux:python_version=='2.7'
|
||||||
|
|
||||||
|
|
||||||
|
Testing
|
||||||
|
-------
|
||||||
|
|
||||||
|
pbr overrides the ``setuptools`` hook ``test`` (i.e. ``setup.py
|
||||||
|
test``). The following sequence is followed:
|
||||||
|
|
||||||
|
#. If a ``.testr.conf`` file exists and `testrepository
|
||||||
|
<https://pypi.python.org/pypi/testrepository>`__ is installed, PBR
|
||||||
|
will use it as the test runner. See the ``testr`` documentation
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
.. note::
|
||||||
|
|
||||||
|
This is separate to ``setup.py testr`` (note the extra ``r``) which
|
||||||
|
is provided directly by the ``testrepository`` package. Be careful
|
||||||
|
as there is some overlap of command arguments.
|
||||||
|
|
||||||
|
#. Although deprecated, if ``[nosetests]`` is defined in ``setup.cfg``
|
||||||
|
and `nose <http://nose.readthedocs.io/en/latest/>`__ is installed,
|
||||||
|
the ``nose`` runner will be used.
|
||||||
|
|
||||||
|
#. In other cases no override will be installed and the ``test``
|
||||||
|
command will revert to `setuptools
|
||||||
|
<http://setuptools.readthedocs.io/en/latest/setuptools.html#test-build-package-and-run-a-unittest-suite>`__.
|
||||||
|
|
||||||
|
A typical usage would be in ``tox.ini`` such as::
|
||||||
|
|
||||||
|
[tox]
|
||||||
|
minversion = 2.0
|
||||||
|
skipsdist = True
|
||||||
|
envlist = py33,py34,py35,py26,py27,pypy,pep8,docs
|
||||||
|
|
||||||
|
[testenv]
|
||||||
|
usedevelop = True
|
||||||
|
setenv =
|
||||||
|
VIRTUAL_ENV={envdir}
|
||||||
|
CLIENT_NAME=pbr
|
||||||
|
deps = .
|
||||||
|
-r{toxinidir}/test-requirements.txt
|
||||||
|
commands =
|
||||||
|
python setup.py test --testr-args='{posargs}'
|
||||||
|
|
||||||
|
The argument ``--coverage`` will set ``PYTHON`` to ``coverage run`` to
|
||||||
|
produce a coverage report. ``--coverage-package-name`` can be used to
|
||||||
|
modify or narrow the packages traced.
|
||||||
|
|
||||||
Additional Docs
|
Additional Docs
|
||||||
===============
|
===============
|
||||||
|
|
||||||
|
|
|
@ -26,16 +26,18 @@
|
||||||
# license you chose for the specific language governing permissions and
|
# license you chose for the specific language governing permissions and
|
||||||
# limitations under that license.
|
# limitations under that license.
|
||||||
|
|
||||||
"""setuptools/distutils commands to run testr via setup.py
|
"""setuptools/distutils command to run testr via setup.py
|
||||||
|
|
||||||
Currently provides 'testr' which runs tests using testr. You can pass
|
PBR will hook in the Testr class to provide "setup.py test" when
|
||||||
--coverage which will also export PYTHON='coverage run --source <your package>'
|
.testr.conf is present in the repository (see pbr/hooks/commands.py).
|
||||||
and automatically combine the coverage from each testr backend test runner
|
|
||||||
after the run completes.
|
If we are activated but testrepository is not installed, we provide a
|
||||||
|
sensible error.
|
||||||
|
|
||||||
|
You can pass --coverage which will also export PYTHON='coverage run
|
||||||
|
--source <your package>' and automatically combine the coverage from
|
||||||
|
each testr backend test runner after the run completes.
|
||||||
|
|
||||||
To use, just use setuptools/distribute and depend on testr, and it should be
|
|
||||||
picked up automatically (as the commands are exported in the testrepository
|
|
||||||
package metadata.
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from distutils import cmd
|
from distutils import cmd
|
||||||
|
|
|
@ -41,8 +41,6 @@ autodoc_tree_excludes =
|
||||||
[entry_points]
|
[entry_points]
|
||||||
distutils.setup_keywords =
|
distutils.setup_keywords =
|
||||||
pbr = pbr.core:pbr
|
pbr = pbr.core:pbr
|
||||||
distutils.commands =
|
|
||||||
testr = pbr.testr_command:Testr
|
|
||||||
egg_info.writers =
|
egg_info.writers =
|
||||||
pbr.json = pbr.pbr_json:write_pbr_json
|
pbr.json = pbr.pbr_json:write_pbr_json
|
||||||
console_scripts =
|
console_scripts =
|
||||||
|
|
4
tox.ini
4
tox.ini
|
@ -11,7 +11,7 @@ setenv =
|
||||||
CLIENT_NAME=pbr
|
CLIENT_NAME=pbr
|
||||||
deps = -r{toxinidir}/test-requirements.txt
|
deps = -r{toxinidir}/test-requirements.txt
|
||||||
commands =
|
commands =
|
||||||
python setup.py testr --testr-args='{posargs}'
|
python setup.py test --testr-args='{posargs}'
|
||||||
|
|
||||||
[tox:jenkins]
|
[tox:jenkins]
|
||||||
sitepackages = True
|
sitepackages = True
|
||||||
|
@ -24,7 +24,7 @@ commands = python setup.py build_sphinx
|
||||||
|
|
||||||
[testenv:cover]
|
[testenv:cover]
|
||||||
commands =
|
commands =
|
||||||
python setup.py testr --coverage
|
python setup.py test --coverage
|
||||||
|
|
||||||
[testenv:venv]
|
[testenv:venv]
|
||||||
commands = {posargs}
|
commands = {posargs}
|
||||||
|
|
Loading…
Reference in New Issue