From 4027c99350ba068f87e9c5e7887095350cd011ae Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Mon, 1 Jan 2024 10:07:30 +0200 Subject: [PATCH] Skip test when ftp.gnu.org not available --- test/unit/files/test_ftp.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/test/unit/files/test_ftp.py b/test/unit/files/test_ftp.py index 55b63944dc01..0a8d3018344d 100644 --- a/test/unit/files/test_ftp.py +++ b/test/unit/files/test_ftp.py @@ -1,5 +1,8 @@ import os +import pytest +from fs.errors import RemoteConnectionError + from ._util import ( assert_realizes_contains, configured_file_sources, @@ -19,12 +22,15 @@ def test_file_source_ftp_specific(): assert file_source_pair.path == test_url assert file_source_pair.file_source.id == "test1" - assert_realizes_contains( - file_sources, - test_url, - "This is ftp.gnu.org, the FTP server of the the GNU project.", - user_context=user_context, - ) + try: + assert_realizes_contains( + file_sources, + test_url, + "This is ftp.gnu.org, the FTP server of the the GNU project.", + user_context=user_context, + ) + except RemoteConnectionError: + pytest.skip("ftp.gnu.org not available") def test_file_source_ftp_generic():