diff --git a/pkgs/development/python-modules/salmon-mail/default.nix b/pkgs/development/python-modules/salmon-mail/default.nix index 49e9a3fc2fae..a15e50001bdf 100644 --- a/pkgs/development/python-modules/salmon-mail/default.nix +++ b/pkgs/development/python-modules/salmon-mail/default.nix @@ -23,6 +23,11 @@ buildPythonPackage rec { hash = "sha256-ysBO/ridfy7YPoTsVwAxar9UvfM/qxrx2dp0EtDNLvE="; }; + patches = [ + # Fix test_main expecting exit code 0 from click group with no args (click 8.2 returns 2). + ./test-main-click-8.2-exit-code.patch + ]; + nativeCheckInputs = [ jinja2 unittestCheckHook diff --git a/pkgs/development/python-modules/salmon-mail/test-main-click-8.2-exit-code.patch b/pkgs/development/python-modules/salmon-mail/test-main-click-8.2-exit-code.patch new file mode 100644 index 000000000000..ec1d4f735c40 --- /dev/null +++ b/pkgs/development/python-modules/salmon-mail/test-main-click-8.2-exit-code.patch @@ -0,0 +1,12 @@ +--- a/tests/test_command.py ++++ b/tests/test_command.py +@@ -48,7 +48,8 @@ + def test_main(self): + runner = CliRunner() + result = runner.invoke(commands.main) +- self.assertEqual(result.exit_code, 0) ++ # click 8.2 changed the exit code when no_args_is_help displays help: 0 -> 2. ++ self.assertEqual(result.exit_code, 2) + + @patch('salmon.queue.Queue') + def test_queue_command(self, MockQueue):