complex_types

polyfactory.value_generators.complex_types.handle_collection_type(field_meta: FieldMeta, container_type: type, factory: type[BaseFactory[Any]], field_build_parameters: Any | None = None, build_context: BuildContext | None = None) Any[source]

Handle generation of container types recursively.

Parameters:
  • container_type – A type that can accept type arguments.

  • factory – A factory.

  • field_meta – A field meta instance.

  • field_build_parameters – Any build parameters passed to the factory as kwarg values.

  • build_context – BuildContext data for current build.

Returns:

A built result.

polyfactory.value_generators.complex_types.handle_collection_type_coverage(field_meta: FieldMeta, container_type: type, factory: type[BaseFactory[Any]], build_context: BuildContext | None = None) Any[source]

Handle coverage generation of container types recursively.

Parameters:
  • container_type – A type that can accept type arguments.

  • factory – A factory.

  • field_meta – A field meta instance.

Returns:

An unresolved built result.