You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/06/07 11:36:29 UTC

[GitHub] [arrow] pitrou commented on a diff in pull request #13325: ARROW-16709: [Docs][Python] Add how to run doctests to the developer guide

pitrou commented on code in PR #13325:
URL: https://github.com/apache/arrow/pull/13325#discussion_r891105648


##########
docs/source/developers/python.rst:
##########
@@ -112,6 +112,32 @@ For running the benchmarks, see :ref:`python-benchmarks`.
 
 .. _build_pyarrow:
 
+Doctest

Review Comment:
   This should probably be a subsection of "Unit tests"? (just above "Benchmarking" probably)



##########
docs/source/developers/python.rst:
##########
@@ -112,6 +112,32 @@ For running the benchmarks, see :ref:`python-benchmarks`.
 
 .. _build_pyarrow:
 
+Doctest
+=======
+
+We are using `doctest <https://docs.python.org/3/library/doctest.html>`_
+to check that docstrings examples are up-to-date and correct. You can

Review Comment:
   ```suggestion
   to check that docstring examples are up-to-date and correct. You can
   ```



##########
docs/source/developers/python.rst:
##########
@@ -112,6 +112,32 @@ For running the benchmarks, see :ref:`python-benchmarks`.
 
 .. _build_pyarrow:
 
+Doctest
+=======
+
+We are using `doctest <https://docs.python.org/3/library/doctest.html>`_
+to check that docstrings examples are up-to-date and correct. You can
+also do that locally by running:
+
+.. code-block::
+
+   $ pushd arrow/python
+   $ pytest --doctest-modules

Review Comment:
   Nit, but we use `python -m pytest` in other pytest-based snippets above.



##########
docs/source/developers/python.rst:
##########
@@ -112,6 +112,32 @@ For running the benchmarks, see :ref:`python-benchmarks`.
 
 .. _build_pyarrow:
 
+Doctest
+=======
+
+We are using `doctest <https://docs.python.org/3/library/doctest.html>`_
+to check that docstrings examples are up-to-date and correct. You can
+also do that locally by running:
+
+.. code-block::
+
+   $ pushd arrow/python
+   $ pytest --doctest-modules
+   $ pytest --doctest-modules path/to/module.py # checking single file
+   $ popd
+
+for ``.py`` files or
+
+.. code-block::
+
+   $ pushd arrow/python
+   $ pytest --doctest-cython
+   $ pytest --doctest-cython path/to/module.pyx # checking single file
+   $ popd
+
+for ``.pyx`` and ``.pxi`` files. In this case you will also need to
+install `pytest-cython <https://github.com/lgpage/pytest-cython>`_ plugin.

Review Comment:
   ```suggestion
   install the `pytest-cython <https://github.com/lgpage/pytest-cython>`_ plugin.
   ```



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org