Skip to content

Commit f6f3b06

Browse files
committed
tests: Handle click 7.1+
A recent change in click [1] has tweaked the output formatting for error messages. Handle the diff. [1] pallets/click@718485be#diff-fb2a32ceb27b1c3d30b386fbae56f34e Signed-off-by: Stephen Finucane <stephen@that.guru> Closes: #53
1 parent cbc304c commit f6f3b06

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tests/test_patch.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import unittest
22

3+
import click
34
from click.testing import CliRunner as CLIRunner
45
import mock
6+
from packaging import version
57

68
from git_pw import patch
79

@@ -260,7 +262,10 @@ def test_update_with_invalid_state(
260262
'123', '--state', 'bar'])
261263

262264
assert result.exit_code == 2, result
263-
assert 'Invalid value for "--state"' in result.output, result
265+
if version.parse(click.__version__) >= version.Version('7.1'):
266+
assert "Invalid value for '--state'" in result.output, result
267+
else:
268+
assert 'Invalid value for "--state"' in result.output, result
264269

265270
@mock.patch('git_pw.api.index')
266271
def test_update_with_delegate(

0 commit comments

Comments
 (0)