Deprecate testr and nose integration

These are not recommended for use in OpenStack anymore and both nose and
testr offer native setuptools commands that can be manually aliased to
'test' on a per-project basis if necessary. Deprecate with an eye to
removal in the future.

Change-Id: I753f2ffe8b223b180b8ed813d879b3a28b47a1ab
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
This commit is contained in:
Stephen Finucane 2017-11-07 04:46:19 +00:00
parent 73cc4189ca
commit 113685e1b9
3 changed files with 24 additions and 1 deletions

View File

@ -27,6 +27,7 @@ import email.errors
import os
import re
import sys
import warnings
import pkg_resources
import setuptools
@ -259,8 +260,14 @@ try:
"""Fallback test runner if testr is a no-go."""
command_name = 'test'
description = 'DEPRECATED: Run unit tests using nose'
def run(self):
warnings.warn('nose integration in pbr is deprecated. Please use '
'the native nose setuptools configuration or call '
'nose directly',
DeprecationWarning)
# Can't use super - base class old-style class
commands.nosetests.run(self)

View File

@ -45,13 +45,14 @@ import distutils.errors
import logging
import os
import sys
import warnings
logger = logging.getLogger(__name__)
class TestrReal(cmd.Command):
description = "Run unit tests using testr"
description = "DEPRECATED: Run unit tests using testr"
user_options = [
('coverage', None, "Replace PYTHON with coverage and merge coverage "
@ -100,6 +101,11 @@ class TestrReal(cmd.Command):
def run(self):
"""Set up testr repo, then run testr."""
logger.debug("run called")
warnings.warn('testr integration in pbr is deprecated. Please use '
'the \'testr\' setup command or call testr directly',
DeprecationWarning)
if not os.path.isdir(".testrepository"):
self._run_testr("init")

View File

@ -0,0 +1,10 @@
---
deprecations:
- |
*testr* and *nose* integration has been deprecated. This feature allowed
*pbr* to dynamically configure the test runner used when running
``setup.py test``. However, this target has fallen out of favour in both
the OpenStack and broader Python ecosystem, and both *testr* and *nose*
offer native setuptools commands that can be manually aliased to ``test``
on a per-project basis, if necessary. This feature will be removed in a
future release.