Skip to content

Commit

Permalink
GH-15017: [Python] Harden test_memory.py for use with ARROW_USE_GLOG=…
Browse files Browse the repository at this point in the history
…ON (#36901)

Accept output pattern for ARROW_USE_GLOG=ON too.

* Closes: #15017

Lead-authored-by: H. Vetinari <h.vetinari@gmx.com>
Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>
  • Loading branch information
h-vetinari and kou committed Jul 28, 2023
1 parent 40debb2 commit 47e438a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 0 additions & 2 deletions dev/tasks/conda-recipes/arrow-cpp/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -403,8 +403,6 @@ outputs:
{% set tests_to_skip = tests_to_skip + " or test_safe_cast_from_float_with_nans_to_int" %} # [ppc64le]
# gandiva tests are segfaulting on ppc
{% set tests_to_skip = tests_to_skip + " or test_float_with_null_as_integer" %} # [ppc64le]
# "Unsupported backend 'nonexistent' specified in ARROW_DEFAULT_MEMORY_POOL"
{% set tests_to_skip = tests_to_skip + " or (test_memory and test_env_var)" %} # [unix]
# test is broken; header is in $PREFIX, not $SP_DIR
{% set tests_to_skip = tests_to_skip + " or (test_misc and test_get_include)" %} # [unix]
# flaky tests that fail occasionally
Expand Down
10 changes: 8 additions & 2 deletions python/pyarrow/tests/test_memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,14 @@ def check_env_var(name, expected, *, expect_warning=False):
res.check_returncode() # fail
errlines = res.stderr.splitlines()
if expect_warning:
assert len(errlines) == 1
assert f"Unsupported backend '{name}'" in errlines[0]
assert len(errlines) in (1, 2)
if len(errlines) == 1:
# ARROW_USE_GLOG=OFF
assert f"Unsupported backend '{name}'" in errlines[0]
else:
# ARROW_USE_GLOG=ON
assert "InitGoogleLogging()" in errlines[0]
assert f"Unsupported backend '{name}'" in errlines[1]
else:
assert len(errlines) == 0

Expand Down

0 comments on commit 47e438a

Please sign in to comment.