mirror of
https://github.com/apache/arrow.git
synced 2026-10-28 16:47:19 +08:00
This PR tries to connect the PyArrow C++ tests with PyArrow tests so they can all be run from `pytest`. This will remove GoogleTest as a dependency for PyArrow and therefore a change is needed in the C++ tests so they return a Status which can then be checked through Cython/Python. Example of pytest run: ``` pyarrow/tests/test_cpp_internals.py::test_owned_ref_moves PASSED pyarrow/tests/test_cpp_internals.py::test_owned_ref_nogil_moves PASSED pyarrow/tests/test_cpp_internals.py::test_check_pyerror_status PASSED pyarrow/tests/test_cpp_internals.py::test_check_pyerror_status_nogil PASSED pyarrow/tests/test_cpp_internals.py::test_restore_pyerror_basics PASSED pyarrow/tests/test_cpp_internals.py::test_pybuffer_invalid_input_object PASSED pyarrow/tests/test_cpp_internals.py::test_pybuffer_numpy_array PASSED pyarrow/tests/test_cpp_internals.py::test_numpybuffer_numpy_array PASSED pyarrow/tests/test_cpp_internals.py::test_python_decimal_to_string PASSED pyarrow/tests/test_cpp_internals.py::test_infer_precision_and_scale PASSED pyarrow/tests/test_cpp_internals.py::test_infer_precision_and_negative_scale PASSED pyarrow/tests/test_cpp_internals.py::test_infer_all_leading_zeros PASSED pyarrow/tests/test_cpp_internals.py::test_infer_all_leading_zeros_exponential_notation_positive PASSED pyarrow/tests/test_cpp_internals.py::test_infer_all_leading_zeros_exponential_notation_negative PASSED pyarrow/tests/test_cpp_internals.py::test_object_block_write_fails PASSED pyarrow/tests/test_cpp_internals.py::test_mixed_type_fails PASSED pyarrow/tests/test_cpp_internals.py::test_from_python_decimal_rescale_not_truncateable PASSED pyarrow/tests/test_cpp_internals.py::test_from_python_decimal_rescale_truncateable PASSED pyarrow/tests/test_cpp_internals.py::test_from_python_negative_decimal_rescale PASSED pyarrow/tests/test_cpp_internals.py::test_decimal128_from_python_integer PASSED pyarrow/tests/test_cpp_internals.py::test_decimal256_from_python_integer PASSED pyarrow/tests/test_cpp_internals.py::test_decimal128_overflow_fails PASSED pyarrow/tests/test_cpp_internals.py::test_decimal256_overflow_fails PASSED pyarrow/tests/test_cpp_internals.py::test_none_and_nan PASSED pyarrow/tests/test_cpp_internals.py::test_mixed_precision_and_scale PASSED pyarrow/tests/test_cpp_internals.py::test_mixed_precision_and_scale_sequence_convert PASSED pyarrow/tests/test_cpp_internals.py::test_simple_inference PASSED pyarrow/tests/test_cpp_internals.py::test_update_with_nan PASSED ``` Lead-authored-by: Alenka Frim <frim.alenka@gmail.com> Co-authored-by: Antoine Pitrou <antoine@python.org> Signed-off-by: Antoine Pitrou <antoine@python.org>
34 lines
1.2 KiB
Cython
34 lines
1.2 KiB
Cython
# Licensed to the Apache Software Foundation (ASF) under one
|
|
# or more contributor license agreements. See the NOTICE file
|
|
# distributed with this work for additional information
|
|
# regarding copyright ownership. The ASF licenses this file
|
|
# to you under the Apache License, Version 2.0 (the
|
|
# "License"); you may not use this file except in compliance
|
|
# with the License. You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing,
|
|
# software distributed under the License is distributed on an
|
|
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
# KIND, either express or implied. See the License for the
|
|
# specific language governing permissions and limitations
|
|
# under the License.
|
|
|
|
# distutils: language = c++
|
|
# cython: language_level = 3
|
|
|
|
from pyarrow.includes.common cimport *
|
|
from pyarrow.includes.libarrow cimport CStatus
|
|
|
|
|
|
ctypedef CStatus cb_test_func()
|
|
|
|
cdef extern from "arrow/python/python_test.h" namespace "arrow::py::testing" nogil:
|
|
|
|
cdef cppclass CTestCase "arrow::py::testing::TestCase":
|
|
c_string name
|
|
cb_test_func func
|
|
|
|
vector[CTestCase] GetCppTestCases()
|