pytest-dev / pytest-dev/pytest-factoryboy
Parametrized traits are not called from fixture in overriden Factory
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 400
- Forks
- 44
- Avg merge
- 6h 34m
- Merged PRs (30d)
- 1
Description
The general way to reproduce this is:
- I have a Django Model with a method
- I create a factory for that model with
factory.django.DjangoModelFactory - I register a trait using
factory.PostGenerationMethodCall - I make a subclass of that factory
- I register a factory for that subclass
If I use the factory in a test, the method will not be called.
If I make a pytest fixture manually, calling the overridden factory directly, the method is called.
Since it's an involved case, I'll try to come up with a minimal example to reproduce this on github and reference this issue.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the five-step scenario with a Django model, DjangoModelFactory, PostGenerationMethodCall, an overridden factory, and a pytest fixture. Compare the fixture's overridden-factory path with calling that factory directly; done means the registered method is called when the factory is used in a test, with a minimal example documenting the failure.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- django, python
- Domain
- backend, testing
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100