Home Machine Learning Configuring Pytest to Run Doctest | by Marcin Kozak | Apr, 2024

Configuring Pytest to Run Doctest | by Marcin Kozak | Apr, 2024

0
Configuring Pytest to Run Doctest | by Marcin Kozak | Apr, 2024

[ad_1]

PYTHON PROGRAMMING

Discover ways to configure pytest in pyproject.toml to run doctests

Photograph by Paul Hanaoka on Unsplash

Fashionable Python tasks are managed by pyproject.toml recordsdata. You should utilize it to handle each common tasks and Python packages, which makes this file a normal software to arrange Python tasks of varied sorts.

The pyproject.toml file can include every little thing your venture wants, like:

  • Metadata, such because the title of the venture, model, authors, license, classifiers, URL, and outline (each brief and lengthy).
  • The configuration of the event and manufacturing atmosphere, that means dependencies and non-obligatory dependencies.
  • Configuration of improvement instruments, equivalent to black, ruff, pylint, pytest, and lots of others.

When the venture will get large, you possibly can transfer a lot of this data to different configuration recordsdata, like pytest.ini, necessities.txt, requirements_dev.txt, and so forth. However when a pyproject.toml doesn’t get overly lengthy, I preserve all the knowledge inside it — this makes the venture’s root listing small.

That is simply primary details about pyproject.toml recordsdata. If you wish to be taught extra about utilizing it, you are able to do so from right here:

[ad_2]