- Declare compatibility with python 3.13
- Drop support for pytest < 7.0.0.
- Declare required python version >= 3.8. (python 3.7 support was already removed in 2.6.0, the declared supported version tag was not updated though). #215
- Address compatibility issue with pytest 8.1. #213
- Drop python 3.7 support and add support for python 3.12. Supported versions are now: 3.8, 3.9, 3.10, 3.11, 3.12. #197
- Drop support for pytest < 6.2. We now support only pytest >= 6.2 (tested against pytest 7.4 at the time of writing). #197
- Using a generic class container like
dict
,list
,set
, etc. will raise a warning suggesting you to wrap your model usingnamed_model(...)
. Doing this will make sure that the fixture name is correctly chosen, otherwise SubFactory and RelatedFactory aren't able to determine the name of the model. See Generic Container Classes as models #167 - Fix
Factory._after_postgeneration
being invoked twice. #164 #156 - Stack traces caused by pytest-factoryboy are now slimmer. #169
- Check for naming conflicts between factory and model fixture name, and raise a clear error immediately. #86
LazyFixture
is now a Generic[T] type.- Simplify fixture generation (internal change).
- Use poetry (internal change).
@register()
decorator now refuses kwargs after the initial specialization. This behaviour was mistakenly introduced in version 2.2.0, and it complicates the usage of theregister
function unnecessarily. For example, the following is not allowed anymore:
# INVALID
register(
_name="second_author",
name="C.S. Lewis",
)(
AuthorFactory,
register_user="cs_lewis",
register_user__password="Aslan1",
)
# VALID
register(
AuthorFactory,
_name="second_author",
name="C.S. Lewis",
register_user="cs_lewis",
register_user__password="Aslan1",
)
- Drop support for Python 3.6. We now support only python >= 3.7.
- Improve "debuggability". Internal pytest-factoryboy calls are now visible when using a debugger like PDB or PyCharm.
- Add type annotations. Now
register
andLazyFixture
are type annotated. - Fix Factory._after_postgeneration method not getting the evaluated
post_generations
andRelatedFactory
results correctly in theresult
param. - Factories can now be registered inside classes (even nested classes) and they won't pollute the module namespace.
- Allow the
@register
decorator to be called with parameters:
@register
@register("other_author")
class AuthorFactory(Factory):
...
- Add support for factory_boy >= 3.2.0
- Drop support for Python 2.7, 3.4, 3.5. We now support only python >= 3.6.
- Drop support for pytest < 4.6. We now support only pytest >= 4.6.
- Add missing versions of python (3.9 and 3.10) and pytest (6.x.x) to the CI test matrix.
- Fix compatibility with pytest 5.
- Fix warning use of getfuncargvalue is deprecated, use getfixturevalue (sliverc)
Breaking change due to the heavy refactor of both pytest and factory_boy.
- Failing test for using a attributes field on the factory (blueyed)
- Minimal pytest version is 3.3.2 (olegpidsadnyi)
- Minimal factory_boy version is 2.10.0 (olegpidsadnyi)
- use {posargs} in pytest command (blueyed)
- pin factory_boy<2.9 (blueyed)
- fix LazyFixture evaluation order (olegpidsadnyi)
- replace request._fixturedefs by request._fixture_defs (p13773)
- fix post-generation dependencies (olegpidsadnyi)
- automatic resolution of the post-generation dependencies (olegpidsadnyi, kvas-it)
- fixes fixture function module name attribute (olegpidsadnyi)
- fixes _after_postgeneration hook invocation for deferred post-generation declarations (olegpidsadnyi)
- support factory models to be passed as strings (bubenkoff)
- circular dependency determination is fixed for the post-generation (olegpidsadnyi)
- circular dependency determination is fixed for the RelatedFactory attributes (olegpidsadnyi)
- fix installation issue when django environment is not set (bubenkoff, amakhnach)
- fixture dependencies on deferred post-generation declarations (olegpidsadnyi)
- post_generation extra parameters fixed (olegpidsadnyi)
- fixture partial specialization (olegpidsadnyi)
- fixes readme and example (dduong42)
- lazy fixtures (olegpidsadnyi)
- deferred post-generation evaluation (olegpidsadnyi)
- hooks (olegpidsadnyi)
- refactoring of the fixture function compilation (olegpidsadnyi)
- related factory fix (olegpidsadnyi)
- post_generation fixture dependency fixed (olegpidsadnyi)
- model fixture registration with specific name (olegpidsadnyi)
- README updated (olegpidsadnyi)
- use
inflection
package to convert camel case to underscore (bubenkoff)
- initial release (olegpidsadnyi)