Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Test len without parameterization

We can write several test function. One for each string:

import pytest

def test_case_foo():
    assert len("Foo") == 3

def test_case_bar():
    assert len("Bar") == 3

def test_case_emojies():
    assert len("🐍🐪🦀") == 3