- add 0001-Skip-test-for-testr-hook-being-installed-when-testr-.patch

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pbr?expand=0&rev=96
This commit is contained in:
Dirk Mueller 2018-09-14 21:20:34 +00:00 committed by Git OBS Bridge
parent 9ec10d4ebd
commit eece5f6f09
3 changed files with 50 additions and 0 deletions

View File

@ -0,0 +1,43 @@
From a4f27ca3972f88e1f494a95ac74fb0c582dd59dd Mon Sep 17 00:00:00 2001
From: Dirk Mueller <dirk@dmllr.de>
Date: Fri, 14 Sep 2018 23:14:47 +0200
Subject: [PATCH] Skip test for testr hook being installed when testr is not
available
pbr only depends on testrepository in the test requirements, so
packaging efforts can decide to skip the dependency if they want to.
As stestr is going to replace testrepository going forward, it makes
sense to make dependencies to testrepository optional.
Skip the test that requires testrepository in that scenario.
Change-Id: I28c30411a5a6fdb071ebcc35e65ce1f4f1242498
---
pbr/tests/test_hooks.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/pbr/tests/test_hooks.py b/pbr/tests/test_hooks.py
index 0fcf96c..3f74790 100644
--- a/pbr/tests/test_hooks.py
+++ b/pbr/tests/test_hooks.py
@@ -41,7 +41,9 @@
import os
from testtools import matchers
+from testtools import skipUnless
+from pbr import testr_command
from pbr.tests import base
from pbr.tests import util
@@ -66,6 +68,7 @@ class TestHooks(base.BaseTestCase):
assert 'test_hook_1\ntest_hook_2' in stdout
assert return_code == 0
+ @skipUnless(testr_command.have_testr, "testrepository not available")
def test_custom_commands_known(self):
stdout, _, return_code = self.run_setup('--help-commands')
self.assertFalse(return_code)
--
2.18.0

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Fri Sep 14 21:18:14 UTC 2018 - dmueller@suse.com
- add 0001-Skip-test-for-testr-hook-being-installed-when-testr-.patch
-------------------------------------------------------------------
Tue Sep 4 08:47:32 UTC 2018 - dmueller@suse.com

View File

@ -35,6 +35,7 @@ License: Apache-2.0
Group: Development/Languages/Python
URL: http://pypi.python.org/pypi/pbr
Source: https://files.pythonhosted.org/packages/source/p/pbr/pbr-%{version}.tar.gz
Patch0: 0001-Skip-test-for-testr-hook-being-installed-when-testr-.patch
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
@ -69,6 +70,7 @@ information.
%prep
%setup -q -n pbr-%{version}
%patch0 -p1
# Get rid of ugly build-time deps that require network:
sed -i "s/, 'sphinx\.ext\.intersphinx'//" doc/source/conf.py