Open a1d4r opened 9 months ago
Thanks for offering a PR, with tests! 🎉
to make this work we need to upgrade factory-boy version up to 3.3.0 - from that version, they added sqlalchemy_session_factory
which is needed for this to work, adjust setup.cfg
and I will add this feature to the next version
Hello, when it will be on master?
There are cases where factory-boy is used not only in tests, but in scripts or even the application itself (for example, populating the real database with fake data). In such scenarios, the provided SQLAlchemy sessions have to be different. However, the current implementation forces users to hardcode the session in the Meta class. For flexibility, I suggest supporting another way to set the session (via callable), with analogy to the following PR: https://github.com/FactoryBoy/factory_boy/pull/927