Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion polyfactory/factories/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,9 @@ class Foo(ModelFactory[MyModel]): # <<< MyModel
"""

factory_bases: Iterable[type[BaseFactory[T]]] = (
b for b in get_original_bases(cls) if get_origin(b) and issubclass(get_origin(b), BaseFactory)
b
for b in get_original_bases(cls)
if (orig := get_origin(b)) and issubclass(orig, BaseFactory)
)
generic_args: Sequence[type[T]] = [
arg for factory_base in factory_bases for arg in get_args(factory_base) if not is_type_var(arg)
Expand Down
Loading