4 ms·
I feel uneasy about using transactions like that. Eventually somebody will be puzzled enough to enable statement logging, which will not contain the data they
by __MatrixMan__ 2y ago
I feel uneasy about using transactions like that. Eventually somebody will be puzzled enough to enable statement logging, which will not contain the data they need. Then they'll set a breakpoint in the test and get a shell on the db to see what's actually there, and they'll find it empty.
And by eventually somebody, I mean two days ago me.
I'd much rather just have a utility that copies the database actually and hands my test the one it's allowed to mess with.
- simonw 2y agoOne trick I've experimented with is setting things up so that if an assertion fails a copy of the full current state of the database is automatically captured and written out to a file on disk.