def run(filename, port_num, run_as, *args, **kwargs): ptvsd.log.to_file() ptvsd.log.info('run{0!r}', (filename, port_num, run_as)) address = (LOCALHOST, port_num) run_main(address, filename, run_as, *args, **kwargs)
def handle_args(addr, name, kind, extra=(), nodebug=False, **kwargs): if kind == 'pid': attach_main(addr, name, *extra, **kwargs) elif nodebug: run_main(addr, name, kind, *extra, **kwargs) else: debug_main(addr, name, kind, *extra, **kwargs)
def test_nodebug_module_no_args(self): addr = Address.as_server('10.0.1.1', 8888) run_main(addr, 'spam.py', 'module', _runner=self._no_debug_runner) self.assertEqual(self.argv, ['spam.py']) self.assertEqual(self.addr, Address.as_server(*addr)) self.assertTrue(self.is_module) self.assertEqual(self.args, ()) self.assertEqual(self.kwargs, {})
def test_nodebug_module_args(self): addr = (None, 8888) args = ('--one', '--two', '--three') run_main(addr, 'spam.py', 'module', *args, _runner=self._no_debug_runner) self.assertEqual(self.argv, ['spam.py'] + list(args)) self.assertEqual(self.addr, Address.as_server(*addr)) self.assertTrue(self.is_module) self.assertEqual(self.args, args) self.assertEqual(self.kwargs, {})
def run(filename, port_num, run_as, *args, **kwargs): address = (LOCALHOST, port_num) run_main(address, filename, run_as, *args, **kwargs)
def main(addr, name, kind, extra=(), nodebug=False, **kwargs): if nodebug: run_main(addr, name, kind, *extra, **kwargs) else: debug_main(addr, name, kind, *extra, **kwargs)