factoryboy/factory_boy

A test fixtures replacement for Python

View on GitHub ↗Jump to charts ↓

Summary Information

Updated 19 minutes ago
Added to GitGenius on September 18th, 2026
Created on May 11th, 2011
Open Issues & Pull Requests: 211 (+0)
GitHub issues: Enabled
Number of forks: 422
Total Stargazers: 3,806 (+0)
Total Subscribers: 36 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 2.6 days
Mean response time: 52.6 days
90th percentile: 113.4 days
Tracked items: 46

Most active contributors

Sign in to see contributor activity.

How this project is maintained

96% of open issues come from outside the core team, so the backlog reflects real-world use rather than internal planning. Three people close 75% of everything that gets resolved.

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 26
New in 7 days: 0
Closed in 7 days: 0
Avg open age: 1,556 days
Stale 30+ days: 26
Stale 90+ days: 22

Recent activity

Opened in 7 days: 0
Closed in 7 days: 0
Comments in 7 days: 0
Events in 7 days: 0

Top labels

  • Q&A (10)
  • Feature (7)
  • Doc (3)
  • Improvement (3)
  • SQLAlchemy (3)
  • DesignDecision (2)
  • Django (2)
  • NeedInfo (2)

Most active issues this week

No issue events were indexed in the last 7 days.

Detailed Description

factory_boy is a test fixtures replacement for Python that generates test data through a declarative factory pattern instead of static fixture files.

The tool solves the problem of managing test data by allowing developers to define factories as classes that produce model instances with sensible defaults. Rather than maintaining separate fixture files or writing repetitive setup code, factories generate objects on demand with customizable attributes. The approach works by letting developers declare a factory for each model, specifying default values and relationships, then call the factory in tests to create instances with those defaults overridden as needed. This makes tests more readable and reduces duplication across test suites.

The tool suits projects using Django, SQLAlchemy, or other ORMs where test data setup becomes tedious. It works well for teams that want to avoid the brittleness of static fixtures while keeping test code concise. Developers should choose factory_boy if they find themselves writing similar object creation code across multiple tests or managing complex relationships between test objects. The project is particularly valuable in larger test suites where fixture maintenance becomes a burden.

The project maintains steady engagement with regular updates addressing user-reported issues and feature requests. Development shows responsiveness to the community through consistent issue triage and incorporation of feedback. The codebase receives ongoing refinement to support evolving Python and framework versions. The project demonstrates commitment to backward compatibility while gradually modernizing its implementation. Documentation receives active maintenance to reflect current usage patterns and best practices.