Esempio n. 1
0
def run_handler(args: argparse.Namespace, stdout: IO, stderr: IO) -> None:
    # remove initial `monkeytype run`
    old_argv = sys.argv.copy()
    sys.argv = sys.argv[2:]
    try:
        with trace(args.config):
            runpy.run_path(args.script_path, run_name='__main__')
    finally:
        sys.argv = old_argv
Esempio n. 2
0
def main():
    print(add(1, 3))
    print(remove_space('I am Stranger.'))
    print(double_list([1, 2, 3]))
    d = {'key1': [1, 2, 3], 'key2': [4, 5, 6], 'key3': [7, 8, 9]}
    convert_dict_to_df(d)

    with monkeytype.trace():
        mul(2, 2)
    return
Esempio n. 3
0
def run_handler(args: argparse.Namespace, stdout: IO, stderr: IO) -> None:
    # remove initial `monkeytype run`
    old_argv = sys.argv.copy()
    try:
        with trace(args.config):
            sys.argv = [args.script_path] + args.script_args
            if args.m:
                runpy.run_module(args.script_path, run_name='__main__', alter_sys=True)
            else:
                runpy.run_path(args.script_path, run_name='__main__')
    finally:
        sys.argv = old_argv