def faker(request):
    """Fixture that returns a seeded and suitable ``Faker`` instance."""
    if "faker_locale" in request.fixturenames:
        locale = request.getfixturevalue("faker_locale")
        fake = Faker(locale=locale)
    else:
        fake = request.getfixturevalue("_session_faker")

    seed = DEFAULT_SEED
    if "faker_seed" in request.fixturenames:
        seed = request.getfixturevalue("faker_seed")
    fake.seed_instance(seed=seed)
    fake.unique.clear()

    return fake
Fixture that returns a seeded and suitable ``Faker`` instance.
faker/contrib/pytest/plugin.py