python3Packages.salmon-mail: fix test_main exit code on click 8.2+ (#523372)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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):
|
||||
Reference in New Issue
Block a user