def create_example_fixture(example):
@pytest.fixture<EOL>def example_app():<EOL><INDENT>p = SimplePty.spawn(['<STR_LIT>', example])<EOL>yield p<EOL>time.sleep(p.delayafterterminate)<EOL>p.sendintr()  <EOL>p.wait()  <EOL><DEDENT>return example_app<EOL>
Create a pytest fixture to run the example in pty subprocess & cleanup.

    :param example: relative path like 'examples/input.py'
    :return: pytest fixture