

def setUp(self):
    with mock.patch('client.g2p.diagnose.check_executable', return_value=True):
        with tempfile.NamedTemporaryFile() as f:
            conf = g2p.PhonetisaurusG2P.get_config().items()
            with mock.patch.object(g2p.PhonetisaurusG2P, 'get_config', classmethod((lambda cls: dict((conf + [('fst_model', f.name)]))))):
                self.g2pconv = g2p.PhonetisaurusG2P(**g2p.PhonetisaurusG2P.get_config())

dataset/ETHPy150Open jasperproject/jasper-client/tests/test_g2p.py TestPatchedG2P.setUp/original