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

kszucs 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 54460d9  ARROW-15420: [Python] Skip if GDB script is not found
54460d9 is described below

commit 54460d96ba1d613e472d8d9a96c072147e736b4d
Author: Krisztián Szűcs <[email protected]>
AuthorDate: Mon Jan 24 01:35:31 2022 +0100

    ARROW-15420: [Python] Skip if GDB script is not found
    
    Prefer more graceful handling for python source distribution.
    
    Closes #12234 from kszucs/gdb-script-skip
    
    Authored-by: Krisztián Szűcs <[email protected]>
    Signed-off-by: Krisztián Szűcs <[email protected]>
---
 python/pyarrow/tests/test_gdb.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/python/pyarrow/tests/test_gdb.py b/python/pyarrow/tests/test_gdb.py
index 893d489..273464f 100644
--- a/python/pyarrow/tests/test_gdb.py
+++ b/python/pyarrow/tests/test_gdb.py
@@ -61,6 +61,11 @@ def skip_if_gdb_unavailable():
         pytest.skip("gdb command unavailable")
 
 
+def skip_if_gdb_script_unavailable():
+    if not os.path.exists(gdb_script):
+        pytest.skip("gdb script not found")
+
+
 class GdbSession:
     proc = None
     verbose = True
@@ -171,7 +176,7 @@ def gdb():
 
 @pytest.fixture(scope='session')
 def gdb_arrow(gdb):
-    assert os.path.exists(gdb_script), "GDB script not found"
+    skip_if_gdb_script_unavailable()
     gdb.run_command(f"source {gdb_script}")
     code = "from pyarrow.lib import _gdb_test_session; _gdb_test_session()"
     out = gdb.run_command(f"run -c '{code}'")

Reply via email to