https://pantsbuild.org/ logo
#general
Title
# general
f

fierce-park-88503

11/05/2018, 10:18 PM
oh, the
yield
could be a
return
in this case I think. but it wouldn’t make it an iterator,
pytest.fixture
does some context-managery stuff for you, so you can do like:
Copy code
@pytest.fixture
def thingy():
  # prepare a_thing
  yield a_thing
  # clean up a_thing
https://docs.pytest.org/en/latest/fixture.html#fixture-finalization-executing-teardown-code