logo


test


<p>We've got a base project going for us, which is nice. But let's add some proper unit tests as well as some code formatters! Note; you can find the live repository for this project <a href="https://github.com/koaning/clumper">here</a>.</p>


1 - Introduction
2 - Structure
3 - Refactor
4 - Conftest
5 - Learn
6 - Pre-Commit
7 - Makefile
8 - Git
9 - Final

Check out our pytest series if you're unfamiliar. To install pytest locally, run:

python -m pip install pytest

After creating the test folder and the empty __init__.py file you can add a single file called test_basics.py with a test in it.

from clumper import Clumper

def test_empty_list():
    assert len(Clumper([]).collect()) == 0

You can confirm that pytest works by running:

pytest

Note; you can find the live repository for this project here.