Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Suggestion: merge .fixture and .yield_fixture #1461
The yield_fixture page says:
My suggestion is to merge
This should be possible - if calling the fixture function returns a generator, then do what
The reason? There will be one less choice for a newcomer to make - which decorator to call.
Further, the documentation section "Fixture finalization / executing teardown code" can now read something like this:
This is a straightforward change, syntactically (
I suggest deprecating the old callback-teardown method since the
Particularly I agree that
I don't think there are backward compatibility issues, because we can use
But I would like to hear what others have to say on this.
I've always thought the same, but I thought there was some obscure reason it was done the way it is rather than combining them since the beginning - seems like I'm wrong?
I've also talked with @hpk42 about yield-fixtures vs. normal fixtures, in the context of the pytest trainings we're giving. He finds it more difficult to teach the
I personally think it's still easier to teach than
If I were to decide, I'd integrate
Depends on what you mean exactly by deprecate, but I would prefer just discourage or note that
As an experienced Python developer learning pytest, having the two merged together would have reduced what I had to learn with pytest.
Also, I'm pretty sure I'll forget (and need to lookup in the doc) the specific name
I do enjoy open source software :).
On Thursday, June 16, 2016, Bruno Oliveira email@example.com wrote: