Yaron Gvili created ARROW-16681:
-----------------------------------

             Summary: [Python] Fix PyArrow unit tests dependant on module path
                 Key: ARROW-16681
                 URL: https://issues.apache.org/jira/browse/ARROW-16681
             Project: Apache Arrow
          Issue Type: Improvement
          Components: Python
            Reporter: Yaron Gvili


The [PyArrow dev docs|https://arrow.apache.org/docs/developers/python.html] 
currently gives
{code:java}
python -m pytest arrow/python/pyarrow{code}
as the unit-testing command, however there are some unit tests (see list at the 
bottom) that currently fail because they depend on the "arrow/python" directory 
being included in the module path whereas it includes instead the current 
directory - see example below.

 

The fix should be either in the unit tests, to avoid the dependency on the 
current directory being in the module path, or in the documentation, to 
instruct that the unit tests should be run from the "arrow/python" directory.

As example for a failed test, for
{code:java}
python -m pytest 
arrow/python/pyarrow/tests/test_misc.py::test_runtime_info{code}
I'm getting an error with this tail:

 
{noformat}
Traceback (most recent call last):
  File "<string>", line 2, in <module>
ModuleNotFoundError: No module named 'pyarrow'
=========================================================================================
 short test summary info 
==========================================================================================
FAILED arrow/python/pyarrow/tests/test_misc.py::test_runtime_info - 
subprocess.CalledProcessError: Command 
'['/mnt/soft1/tscontract/pkg/miniconda3/envs/pyarrow-dev/bin/python', '-c', "if 
1:\n          ...{noformat}
Here is the list of unit tests I'm getting a similar error:

 

 
{noformat}
test_memory.py::test_env_var
test_memory.py::test_debug_memory_pool_abort[default_memory_pool]
test_memory.py::test_debug_memory_pool_abort[jemalloc_memory_pool]
test_memory.py::test_debug_memory_pool_abort[system_memory_pool]
test_memory.py::test_debug_memory_pool_trap[default_memory_pool]
test_memory.py::test_debug_memory_pool_trap[jemalloc_memory_pool]
test_memory.py::test_debug_memory_pool_trap[system_memory_pool]
test_memory.py::test_debug_memory_pool_warn[default_memory_pool]
test_memory.py::test_debug_memory_pool_warn[jemalloc_memory_pool]
test_memory.py::test_debug_memory_pool_warn[system_memory_pool]
test_memory.py::test_debug_memory_pool_disabled[default_memory_pool]
test_memory.py::test_debug_memory_pool_disabled[jemalloc_memory_pool]
test_memory.py::test_debug_memory_pool_disabled[system_memory_pool]
test_misc.py::test_env_var_io_thread_count
test_misc.py::test_runtime_info{noformat}
 



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to