Merge "Deprecate testr and nose integration"

This commit is contained in:
Zuul 2018-01-04 04:09:24 +00:00 committed by Gerrit Code Review
commit 4e859e76d3
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.