diff --git a/flake.nix b/flake.nix index 339f65874..3cd0609a1 100644 --- a/flake.nix +++ b/flake.nix @@ -36,10 +36,6 @@ nativeCheckInputs = with pkgs; [ gnupg notmuch procps ]; checkPhase = '' - # In the nix sandbox stdin is not a terminal but /dev/null so we - # change the shell command only in this specific test. - sed -i '/test_no_spawn_no_stdin_attached/,/^$/s/test -t 0/sh -c "[ $(wc -l) -eq 0 ]"/' tests/commands/test_global.py - python3 -m unittest -v ''; }); diff --git a/tests/commands/test_global.py b/tests/commands/test_global.py index 775a822ce..8932f77a3 100644 --- a/tests/commands/test_global.py +++ b/tests/commands/test_global.py @@ -124,19 +124,19 @@ async def test_no_spawn_stdin_success(self): @utilities.async_test async def test_no_spawn_no_stdin_attached(self): ui = utilities.make_ui() - cmd = g_commands.ExternalCommand('test -t 0', refocus=False) + cmd = g_commands.ExternalCommand('test -p /dev/stdin', refocus=False) await cmd.apply(ui) - ui.notify.assert_not_called() + ui.notify.assert_called_once_with( + 'editor has exited with error code 1 -- No stderr output', + priority='error') @utilities.async_test async def test_no_spawn_stdin_attached(self): ui = utilities.make_ui() cmd = g_commands.ExternalCommand( - "test -t 0", stdin='0', refocus=False) + "test -p /dev/stdin", stdin='0', refocus=False) await cmd.apply(ui) - ui.notify.assert_called_once_with( - 'editor has exited with error code 1 -- No stderr output', - priority='error') + ui.notify.assert_not_called() @utilities.async_test async def test_no_spawn_failure(self):