File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 12
12
# See the License for the specific language governing permissions and
13
13
# limitations under the License.
14
14
15
+ from importlib import metadata
16
+
15
17
import pytest
16
18
17
19
from click .testing import CliRunner
18
20
from imgtool .main import imgtool
19
21
from imgtool import imgtool_version
22
+ from packaging .version import Version
20
23
21
24
# all available imgtool commands
22
25
COMMANDS = [
@@ -53,7 +56,10 @@ def test_help():
53
56
54
57
# by default help should be also produced
55
58
result_empty = runner .invoke (imgtool )
56
- assert result_empty .exit_code == 0
59
+
60
+ # return value without arguments differs based on click version
61
+ expected_exit_code = 2 if Version (metadata .version ("click" )) >= Version ("8.2.0" ) else 0
62
+ assert result_empty .exit_code == expected_exit_code
57
63
assert result_empty .output == result_short .output
58
64
59
65
You can’t perform that action at this time.
0 commit comments