From 8fc959060a7659058de67c92c08ffa8f9b5f2ab7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Saugat=20Pachhai=20=28=E0=A4=B8=E0=A5=8C=E0=A4=97=E0=A4=BE?= =?UTF-8?q?=E0=A4=A4=29?= Date: Mon, 1 Nov 2021 16:21:03 +0545 Subject: [PATCH] tests: skip based on conditional import on pyarrow From now on, pyarrow dependency is optional for the tests. --- tests/remotes/hdfs.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/tests/remotes/hdfs.py b/tests/remotes/hdfs.py index e01b2adcd..4a44961d5 100644 --- a/tests/remotes/hdfs.py +++ b/tests/remotes/hdfs.py @@ -2,7 +2,6 @@ import locale import os import platform import subprocess -import sys import uuid from contextlib import contextmanager from pathlib import Path @@ -74,10 +73,7 @@ class HDFS(Base, URLInfo): # pylint: disable=abstract-method @pytest.fixture(scope="session") def hadoop(test_config): test_config.requires("real_hdfs") - - if sys.version_info >= (3, 10): - pytest.skip("pyarrow is not available for 3.10 yet.") - + pytest.importorskip("pyarrow.fs") if platform.system() != "Linux": pytest.skip("only supported on Linux") @@ -280,9 +276,7 @@ def hdfs(test_config, mocker): # "The pyarrow installation is not built with support for # 'HadoopFileSystem'" test_config.requires("hdfs") - - if sys.version_info >= (3, 10): - pytest.skip("pyarrow is not available for 3.10 yet.") + pytest.importorskip("pyarrow.fs") mocker.patch("pyarrow.fs._not_imported", []) mocker.patch(