PythiloLesson 1 of 5 · progress kept in this browser

Writing tests

A test is a function that sets something up, calls your code, and asserts on the result. pytest finds functions named test_* and runs them. When an assert fails, it shows the values involved.

def add(a, b):
    return a + b

def test_add_negative():
    assert add(2, -3) == -1
Your task

slugify is written for you. Write test_lowercases, test_spaces_become_dashes and test_empty_string, each using a plain assert on a slugify call. Each test must fail if that behaviour breaks.