import ast import multiprocessing import sys def test_ast_parse(expected_tabcheck): ast.parse('if 1:\n\t1\n' + '\x20' * 8 +'1') assert sys.flags.tabcheck == expected_tabcheck, 'sys.flags.tabcheck == {0} != {1}'.format(sys.flags.tabcheck, expected_tabcheck) if __name__ == '__main__': p = multiprocessing.Process( target=test_ast_parse, args=(sys.flags.tabcheck,) ) p.start() p.join()