factory_boy icon indicating copy to clipboard operation
factory_boy copied to clipboard

A test fixtures replacement for Python

Results 185 factory_boy issues
Sort by recently updated
recently updated
newest added

This PR adds basic type hinting support Refs #468

#### Description Factory_boy keeps SQLAlchemy instances passed as argument to factories in memory, causing a memory leak and changing what requests SQLAlchemy performs. The changed behavior for SQLAlchemy, in our...

Bug
BadMagic
SQLAlchemy
Django

#### Description I have a scenario where I need to, based on some condition, ensure that a factory returns an existing object (possibly customising it to match the provided fields)...

Feature

#### Description KeyError: 'locale' generated when calling Faker. factory/faker.py:46: KeyError Seems that the `extra` dictionary is empty, but `locale` key is expected. #### To Reproduce running unit test with tox...

Bug

What this PR is trying to accomplish: * There is a lot of test code linked to a series of nested-russian-doll sub factories of 1-to-3-to-3-to-1 * 10 (`create_batch(10)`) models that...

When working on the PR "[Implements bulk_create for create_batch if available](https://github.com/FactoryBoy/factory_boy/pull/925)" I found the need to ensure that all the code I wrote was properly tested/covered under tests. Started experimenting...

#### The problem Quite a lot of times I'd like to refine a value that can be accessed with a `SelfAttribute`. This can normally be done by combining it with...

`SelfAttribute` will, if given, call and return the return value of the `coerce` function Closes: #963

`DictFactory` and `ListFactory` are defined, and exposed at the module toplevel. They are useful for simple dict/list building, and should be documented.

Doc
BeginnerFriendly
Improvement