3 ms·
But what if the data setup is convoluted? How does one avoid a horrific domino stack of fixtured data?
by mikeyjk 5y ago
But what if the data setup is convoluted? How does one avoid a horrific domino stack of fixtured data?
- simonw 5y agoI find using libraries like factory_boy and pytest's fixtures mechanism makes that horrific domino stack pretty manageable.
- sonthonax 5y agoMan I fucking hate factory boy, by default it fuzzes the input meaning your tests are non deterministic. Honesty, I don’t understand why people use it; how many models do people have where meta programming factory classes makes sense?
- yowlingcat 5y agoI think it comes down to whether you want to maintain a fixture or a factory. In my experience, it can be easy to set up a fixture but over time it increasingly becomes a pain -- sometimes enough that setting up a factory is worth it.