From 7f85e6104efea9b16e7a8f06062bfb7cb62600b6 Mon Sep 17 00:00:00 2001 From: Wes McKinney Date: Thu, 13 Jun 2019 13:08:04 -0500 Subject: [PATCH 1/2] Fix Python-3 syntax only in test_flight.py --- cpp/build-support/lint_cpp_cli.py | 3 ++- python/pyarrow/tests/test_flight.py | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/cpp/build-support/lint_cpp_cli.py b/cpp/build-support/lint_cpp_cli.py index e0fee00cafa..aebe29eaeb7 100644 --- a/cpp/build-support/lint_cpp_cli.py +++ b/cpp/build-support/lint_cpp_cli.py @@ -98,7 +98,8 @@ def lint_files(): # Only run on header files if filename.endswith('.h'): - yield from lint_file(full_path) + for _ in lint_file(full_path): + yield _ if __name__ == '__main__': diff --git a/python/pyarrow/tests/test_flight.py b/python/pyarrow/tests/test_flight.py index a7e6e340c68..e56183e571f 100644 --- a/python/pyarrow/tests/test_flight.py +++ b/python/pyarrow/tests/test_flight.py @@ -23,6 +23,7 @@ import tempfile import threading import time +import traceback import pytest @@ -51,10 +52,11 @@ def read_flight_resource(path): try: with (root / path).open("rb") as f: return f.read() - except FileNotFoundError as e: + except FileNotFoundError: raise RuntimeError( "Test resource {} not found; did you initialize the " - "test resource submodule?".format(root / path)) from e + "test resource submodule?\n{}".format(root / path, + traceback.format_exc())) def example_tls_certs(): From 7130d401ed3d95e91e0fd765db0a1dd47607b917 Mon Sep 17 00:00:00 2001 From: Wes McKinney Date: Thu, 13 Jun 2019 13:34:30 -0500 Subject: [PATCH 2/2] Use pathlib backport --- python/pyarrow/tests/test_flight.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/python/pyarrow/tests/test_flight.py b/python/pyarrow/tests/test_flight.py index e56183e571f..231daf4e301 100644 --- a/python/pyarrow/tests/test_flight.py +++ b/python/pyarrow/tests/test_flight.py @@ -29,9 +29,8 @@ import pyarrow as pa -from pathlib import Path from pyarrow.compat import tobytes - +from pyarrow.util import pathlib flight = pytest.importorskip("pyarrow.flight") @@ -41,7 +40,7 @@ def resource_root(): if not os.environ.get("ARROW_TEST_DATA"): raise RuntimeError("Test resources not found; set " "ARROW_TEST_DATA to /testing") - return Path(os.environ["ARROW_TEST_DATA"]) / "flight" + return pathlib.Path(os.environ["ARROW_TEST_DATA"]) / "flight" def read_flight_resource(path):