From 042f422cf4adfd46cca7f024f1e941bc7c91c911 Mon Sep 17 00:00:00 2001 From: Markus Lehtonen Date: Tue, 23 Jan 2018 10:48:58 +0200 Subject: tests.testutils: helpers for checking existence of commands Add new have_cmd() helper for checking if a command is available, and, a skip_without_cmd() decorator for skipping tests in case a command is missing. Convert existing checks for commands to use these new functions. Signed-off-by: Markus Lehtonen --- tests/11_test_dch_main.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'tests/11_test_dch_main.py') diff --git a/tests/11_test_dch_main.py b/tests/11_test_dch_main.py index d9023c3c..7fc82600 100644 --- a/tests/11_test_dch_main.py +++ b/tests/11_test_dch_main.py @@ -3,12 +3,11 @@ """Test L{gbp.scripts.dch} main""" from . import context -from .testutils import (DebianGitTestRepo, OsReleaseFile, +from .testutils import (DebianGitTestRepo, OsReleaseFile, skip_without_cmd, get_dch_default_urgency, capture_stderr) from gbp.scripts import dch -import unittest import os import re @@ -46,7 +45,7 @@ cl_debian = """test-package (0.9-1) unstable; urgency=%s """ % default_urgency -@unittest.skipIf(not os.path.exists('/usr/bin/debchange'), "Dch not found") +@skip_without_cmd('debchange') class TestScriptDch(DebianGitTestRepo): """Test git-dch""" -- cgit v1.2.3