You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by we...@apache.org on 2019/06/13 22:23:43 UTC

[arrow] branch master updated: ARROW-5596: [Python] Fix Python-3 syntax only in test_flight.py

This is an automated email from the ASF dual-hosted git repository.

wesm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/master by this push:
     new 6675399  ARROW-5596: [Python] Fix Python-3 syntax only in test_flight.py
6675399 is described below

commit 66753993f0138936c6bafec926eae954cbee8883
Author: Wes McKinney <we...@apache.org>
AuthorDate: Thu Jun 13 17:23:33 2019 -0500

    ARROW-5596: [Python] Fix Python-3 syntax only in test_flight.py
    
    Even though Flight is only available in Python 3, having Py3-only syntax is enough to break py.test
    
    Author: Wes McKinney <we...@apache.org>
    
    Closes #4553 from wesm/ARROW-5596 and squashes the following commits:
    
    7130d401e <Wes McKinney> Use pathlib backport
    7f85e6104 <Wes McKinney> Fix Python-3 syntax only in test_flight.py
---
 cpp/build-support/lint_cpp_cli.py   |  3 ++-
 python/pyarrow/tests/test_flight.py | 11 ++++++-----
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/cpp/build-support/lint_cpp_cli.py b/cpp/build-support/lint_cpp_cli.py
index e0fee00..aebe29e 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 a7e6e34..231daf4 100644
--- a/python/pyarrow/tests/test_flight.py
+++ b/python/pyarrow/tests/test_flight.py
@@ -23,14 +23,14 @@ import socket
 import tempfile
 import threading
 import time
+import traceback
 
 import pytest
 
 import pyarrow as pa
 
-from pathlib import Path
 from pyarrow.compat import tobytes
-
+from pyarrow.util import pathlib
 
 flight = pytest.importorskip("pyarrow.flight")
 
@@ -40,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 <repo root>/testing")
-    return Path(os.environ["ARROW_TEST_DATA"]) / "flight"
+    return pathlib.Path(os.environ["ARROW_TEST_DATA"]) / "flight"
 
 
 def read_flight_resource(path):
@@ -51,10 +51,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():