AlenkaF commented on a change in pull request #12375:
URL: https://github.com/apache/arrow/pull/12375#discussion_r806736807
##########
File path: docs/source/developers/guide/step_by_step/testing.rst
##########
@@ -34,13 +34,42 @@ In this section we outline steps needed for unit testing in
Arrow.
.. tabs::
- .. tab:: Pytest
+ .. tab:: PyArrow
We use `pytest <https://docs.pytest.org/en/latest/>`_ for
unit tests in Python. For more info about the required
- packages follow
+ packages see
:ref:`Python unit testing section <python-unit-testing>`.
+ **Structure**
+
+ Test layout in PyArrow follows ``pytest`` structure for
+ `Tests as part of application code
<https://docs.pytest.org/en/6.2.x/goodpractices.html#tests-as-part-of-application-code>`_:
+
+ .. code:: console
+
+ pyarrow/
+ __init__.py
+ csv.py
+ dataset.py
+ ...
+ tests/
+ __init__.py
+ test_csv.py
+ test_dataset.py
+ ...
+
+ Tests for Parquet are located in a separate folder
``pyarrow/tests/parquet/``.
+
+ .. Note::
+
+ Good to read:
+ `Invoking pytest versus python -m pytest
<https://docs.pytest.org/en/6.2.x/pythonpath.html#pytest-vs-python-m-pytest>`_
+ (bottom of the page).
Review comment:
Yeah, I should change `python -m pytest` to `pytest...`, also to match
https://arrow.apache.org/docs/developers/python.html#unit-testing
As for the takeaway, maybe instead of linking I could add this as a note:
"You can also run the tests with `python -m pytest [...]`which is almost
equivalent to using `pytest [...]` directly, except that calling via python
will also add the current directory to `sys.path` and can in some cases help if
`pytest [...]` doesn't seem to work."
What do you think?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]