Is it possible to use this with FactoryBoy?
See original GitHub issueIt would be useful to see an example of how to use pytest-flask-sqlalchemy with FactoryBoy/pytest-factoryboy, if they can work together. For example, I’m not clear what would be used for factory classes’ sqlalchemy_session
field.
(Background: I use something like pytest-flask-sqlalchemy in my tests, and would like to switch to pytest-flask-sqlalchemy when the MySQL PR is included, and would also like to use FactoryBoy, but have never managed to get the two things to work well together.)
Issue Analytics
- State:
- Created 5 years ago
- Comments:17 (2 by maintainers)
Top Results From Across the Web
Using factory_boy with ORMs - Read the Docs
This feature makes it possible to use SubFactory to create embedded document. A minimalist example: import mongoengine class Address(mongoengine.
Read more >Common recipes — Factory Boy stable documentation
Most recipes below take on Django model examples, but can also be used on their own. ... It is also possible to reset...
Read more >factory_boy — Factory Boy stable documentation
factory_boy is designed to work well with various ORMs (Django, MongoDB, SQLAlchemy), and can easily be extended for other libraries. Its main features...
Read more >Reference — Factory Boy stable documentation
Use this attribute to change the strategy used by a Factory . The default is CREATE_STRATEGY . Attributes and methods . class...
Read more >Introduction — Factory Boy stable documentation
Users looking for quick helpers may take a look at Common recipes, ... It is also possible to override the defined attributes by...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@philgyford when a fixture needs anothers fixture you just pass them via paremeters so your fixture book_factory should look like this:
A reproducible example of your setup would help. We use FactoryBoy with pytest-flask-sqlalchemy + postgres without any troubles.