summaryrefslogtreecommitdiffhomepage
path: root/tests/11_test_dch_main.py
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2015-03-27 13:15:17 +0100
committerGuido Günther <agx@sigxcpu.org>2015-03-27 13:36:03 +0100
commit4a53ad73eb4468796317bd1e44273a80b3ec9385 (patch)
tree3f51de49bfedb9937951ef37c63e1ef39e8e30ba /tests/11_test_dch_main.py
parent430be3831596a072f67c4da84a2244da1205e9e6 (diff)
testutils: Add a context manager to capture stderr
and use it to test the help output
Diffstat (limited to 'tests/11_test_dch_main.py')
-rw-r--r--tests/11_test_dch_main.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/11_test_dch_main.py b/tests/11_test_dch_main.py
index 4f271310..538d2e84 100644
--- a/tests/11_test_dch_main.py
+++ b/tests/11_test_dch_main.py
@@ -4,7 +4,7 @@
from . import context
from .testutils import (DebianGitTestRepo, OsReleaseFile,
- get_dch_default_urgency)
+ get_dch_default_urgency, capture_stderr)
from gbp.scripts import dch
@@ -191,7 +191,9 @@ class TestScriptDch(DebianGitTestRepo):
def test_dch_main_new_upstream_version_with_snapshot_release(self):
"""Test dch.py like gbp dch script does: new upstream version - snapshot - release"""
options = ["--snapshot", "--release"]
- self.assertRaises(SystemExit, self.run_dch, options)
+ with capture_stderr() as c:
+ self.assertRaises(SystemExit, self.run_dch, options)
+ self.assertTrue("'--snapshot' and '--release' are incompatible options" in c.output())
def test_dch_main_new_upstream_version_with_distribution(self):