On Wed, 3 Apr 2024 18:52:50 +0200 Petr Machata wrote: > > Nothing wrong with that. I guess the question in my mind is whether > > we're aiming for making the tests "pythonic" (in which case "with" > > definitely wins), or more of a "bash with classes" style trying to > > avoid any constructs people may have to google. I'm on the fence on > > that one, as the del example proves my python expertise is not high. > > OTOH people who prefer bash will continue to write bash tests, > > so maybe we don't have to worry about non-experts too much. Dunno. > > What I'm saying is, bash is currently a bit of a mess when it comes to > cleanups. It's hard to get right, annoying to review, and sometimes > individual cases add state that they don't unwind in cleanup() but only > later in the function, so when you C-c half-way through such case, stuff > stays behind. > > Python has tools to just magic all this away. Understood, just to be clear what I was saying is that +/- bugs in my example it is possible to "attach" the lifetime of things to a test object or such. Maybe people would be less likely to remember to do that than use "with"? Dunno. In any case, IIUC we don't have to decide now, so I went ahead with the v2 last night.