From 37f906236bf4c4a0d025e962d5132be70039320b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sviatoslav=20Sydorenko=20=28=D0=A1=D0=B2=D1=8F=D1=82=D0=BE?= =?UTF-8?q?=D1=81=D0=BB=D0=B0=D0=B2=20=D0=A1=D0=B8=D0=B4=D0=BE=D1=80=D0=B5?= =?UTF-8?q?=D0=BD=D0=BA=D0=BE=29?= Date: Wed, 26 Jun 2024 23:04:52 +0200 Subject: [PATCH] Use `/dev/null` @ copy non-existing remote file test --- tests/unit/scp_test.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/unit/scp_test.py b/tests/unit/scp_test.py index 025bea622..697ba5f5b 100644 --- a/tests/unit/scp_test.py +++ b/tests/unit/scp_test.py @@ -2,6 +2,7 @@ """Tests suite for scp.""" +import os import uuid import pytest @@ -69,8 +70,8 @@ def path_to_non_existent_src_file(tmp_path): return path -def test_get_missing_src(dst_path, path_to_non_existent_src_file, ssh_scp): +def test_get_missing_src(path_to_non_existent_src_file, ssh_scp): """Check that SCP file download raises exception if the remote file is missing.""" error_msg = '^Error receiving information about file:' with pytest.raises(LibsshSCPException, match=error_msg): - ssh_scp.get(str(path_to_non_existent_src_file), str(dst_path)) + ssh_scp.get(str(path_to_non_existent_src_file), os.devnull)