Unit Tests

The fetchit library uses pytest for unit testing.

Install

First, pytest needs to be installed on your system. Easily install it by installing the development dependencies.

$ python3 -m pip install .[dev]

Configuration

The pytest configuration is stored in pyproject.toml.

pyproject.toml
[tool.pytest.ini_options]
minversion = "6.2"
addopts = "-s --showlocals"
testpaths = ["tests"]

Run from the command line

Execute all of the unit tests manually from the command line.

$ python3 -m pytest tests/

Or only run a specific test file.

$ python3 -m pytest tests/test_*.py

Or only run a specific unit test.

$ python3 -m pytest tests/test_*.py::test_*

Last update: Feb 13, 2024