pytest-factoryboy icon indicating copy to clipboard operation
pytest-factoryboy copied to clipboard

factory_boy integration the pytest runner

Results 46 pytest-factoryboy issues
Sort by recently updated
recently updated
newest added

Especially with FactoryBoy 3.2. See failing tests in https://github.com/pytest-dev/pytest-factoryboy/pull/125

# Brief This PR adds support for using `LazyFixture` as a declaration directly in the factory, when using the factory class fixture. This makes the following possible: ```py import factory...

## Work around Decorate the class with `mute_signals`, and additionally override `_after_postgeneration` and mute signals there too. ```python @mute_signals(signals.pre_save, signals.post_save) @register(_name="subscription_no_signals") class SubscriptionNoSignalsFactory(SubscriptionFactory): @classmethod def _after_postgeneration(cls, *args, **kwargs): with mute_signals(signals.pre_save,...

The test is currently marked as xfailed because we never asserted that functionality, but it should pass instead. Basically: ``` class FooFactory: baz = factory.RelatedFactory(BazFactory, "foo") ``` does not set...

## Setup Here are my models: ```python from typing import List from mypy_extensions import TypedDict class WakatimeCommit(TypedDict): """Class to represent a single Wakatime commit instance from API. """ hash: str...

factory_boy List declarations are not working with pytest_factoryboy for me. Below is a simple example that should bring out the issue (and an attachment). Could I please get any feedback...

Hi, I'd like to parametrize use of a Factoryboy [Trait](https://factoryboy.readthedocs.io/en/latest/reference.html#traits). But i don't see my Traits when i list my fixtures, so i get there is something missing here. I...

(I really have no clue what to title this ticket.) What I'm seeing though is that when I register a factory, the model fixture behaves differently when it's called vs....

The failing tests in test_maybe_trait will fail with all factoryboy versions, but has minor consequences, as there is an obvious work-around. They may rely completely inside factory-boy itself, see [this...

It seems to be that `SubFactory` does not work with self-referencing ForeignKey relationships. I have a model with a foreign key to `self`: ``` class MyAuthor(Model): full_name = CharField('Full name',...