@pytest.fixture()
def fake_proc(monkeypatch, stubs):
 p = guiprocess.GUIProcess('testprocess')
 monkeypatch.setattr(p, '_proc', stubs.fake_qprocess())
 return p

@ pytest . fixture ( ) def fake_proc ( monkeypatch , stubs ) : p = guiprocess . GUIProcess ( 'testprocess' ) monkeypatch . setattr ( p , '_proc' , stubs . fake_qprocess ( ) ) return p
a fixture providing a guiprocess with a mocked qprocess .