Re: [pytest-dev] Testing fixture teardown / finalisation

2021-01-06 Thread Brian Okken
Bruno, This is brilliant in that it’s obvious now that I see it, but didn’t occur to me before. Super cool. - Brian > On Jan 6, 2021, at 10:26 AM, Bruno Oliveira wrote: > >  > Hi James, > > What I suggest you do in your case is to decouple your code from the fixture, > so if you have

Re: [pytest-dev] Testing fixture teardown / finalisation

2021-01-06 Thread Bruno Oliveira
Hi James, What I suggest you do in your case is to decouple your code from the fixture, so if you have something like this today: @pytest.fixture(scope="module") def my_work_reqs(): # some # complicated # setup # code yield x # some result

[pytest-dev] Testing fixture teardown / finalisation

2021-01-06 Thread James Cooke
Hi all, It's been a while since I've had to write a complicated and robust pytest fixture and I'm struggling with testing the teardown / finalisation code. Instead of boring you with the [my-work-project] requirements of cleaning up GCS after tests, I'll refer to the fixture in the docs