pytest-faker
Faker integration with the pytest framework.
What it is and what it does
pytest-faker is a thin integration layer that exposes the Faker library as a pytest fixture, allowing test functions to receive a Faker generator instance by declaring a `faker` parameter. Instead of instantiating Faker manually in each test, you get it injected as a session-scoped fixture, simplifying the setup of fake data generation for testing.
The package has been unmaintained since its latest release on 2016-12-19 and carries no runtime dependencies beyond pytest and Faker themselves. Its age and lack of updates create significant uncertainty about compatibility with modern versions of either tool.
Use it for:
- Generate fake names, addresses, or email addresses in unit tests without manual Faker instantiation.
- Create consistent test data across multiple test functions using a shared session-scoped faker fixture.
- Reduce boilerplate in test files by relying on pytest's fixture injection instead of explicit Faker setup.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides pytest fixtures that integrate the Faker library for generating fake data in test functions.
No. The package is abandoned (latest release 2016-12-19, last commit 2020-05-14) with high install friction, making it risky. Faker likely now provides native pytest integration or the community has moved to maintained alternatives. Verify current Faker documentation before considering this package.
Install
pytest-faker on PyPI
pip
pip install pytest-fakeruv
uv add pytest-fakerpoetry
poetry add pytest-fakerInstalling pytest-faker
Before you install
High install friction and abandoned maintenance status. The package has not been updated since 2016-12-19, with the last repository commit in 2020-05-14. No active maintenance or security updates are expected.
License in practice
Licensed under MIT license, a permissive license that allows commercial and private use with minimal restrictions, making it safe from a licensing perspective.
Quickstart
pip install pytest-faker
# In your test file:
def test_faker(faker):
from faker.generator import Generator
assert isinstance(faker, Generator)
assert isinstance(faker.name(), str)
Requires pytest and Faker to be installed; compatibility with modern versions is unclear given the package's age and lack of maintenance.
Verify before relying
- Whether the package works with current versions of pytest and Faker, given no updates since 2016-12-19.
- Whether the package is compatible with Python versions beyond 3.4, which was the latest listed in classifiers.
- Whether Faker itself now provides native pytest integration that supersedes this package.
Package facts
| License | MIT license (permissive) |
| Python support | not specified |
| Install friction | high — source build required |
| Runtime dependencies | none |
| Maintenance | abandoned — 3,525 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 88,524/month — #13,720 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pytest-faker-2.0.0.tar.gz
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
FakerFaker generates realistic fake data—names,…
permissive · top 1,000 on PyPI
pytest-factoryboyIntegrates factory_boy with pytest to register…
permissive · top 5,000 on PyPI
streamlit-fakerGenerates random fake data to populate…
unclear · top 15,000 on PyPI
faker-e164Generates fake E164-formatted phone numbers for…
permissive · top 15,000 on PyPI
pytest-httpbinProvides a pytest fixture that runs a local…
permissive · top 15,000 on PyPI
pytest-djangopytest-django integrates Django with pytest,…
permissive · top 1,000 on PyPI
jsfGenerates realistic fake JSON data from JSON…
permissive · top 15,000 on PyPI
fake-factoryfake-factory is a deprecated package that…
permissive · top 15,000 on PyPI
mimesisMimesis generates realistic fake data across 47…
permissive · top 5,000 on PyPI
robotframework-fakerWraps Faker's random test data generation as…
permissive · top 15,000 on PyPI