Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-16681

[Python] Fix doc for PyArrow unit tests dependant on module path

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 9.0.0
    • Python

    Description

      The PyArrow dev docs currently gives

      python -m pytest arrow/python/pyarrow

      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

      python -m pytest arrow/python/pyarrow/tests/test_misc.py::test_runtime_info

      I'm getting an error with this tail:

       

      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          ...

      Here is the list of unit tests I'm getting a similar error:

       

       

      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

       

      Attachments

        Issue Links

          Activity

            People

              rtpsw Yaron Gvili
              rtpsw Yaron Gvili
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 10m
                  1h 10m