@pytest.fixture(scope='session')
def user_dir(tmpdir_factory):
 return tmpdir_factory.mktemp('user_dir')

@ pytest . fixture ( scope = 'session' ) def user_dir ( tmpdir_factory ) : return tmpdir_factory . mktemp ( 'user_dir' )
fixture that simulates the users home directory .