def test_enforce(): check_on_input( NO_SIX_SAMPLE, EXPECTED_SIX_RESULT, extra_flags=["--enforce"], expected_return_code=2, )
def test_urllib_import_as(): check_on_input(*URLLIB_IMPORT_AS)
def test_next_method(): check_on_input(*NEXT_METHOD)
def test_unicode_type_call(): check_on_input(*UNICODE_TYPE_CALL)
def test_map_ref(): check_on_input(*MAP_REF)
def test_optional(): check_on_input(CLASSIC_DIVISION[0], CLASSIC_DIVISION[0])
def test_raise_string(): check_on_input(*RAISE_STRING)
def test_raise(): check_on_input(*RAISE)
def check_all_types(input, output): for type_ in TYPES: check_on_input(input.format(type=type_), output.format(type=type_))
def test_normal_and_future_imports(): check_on_input(*NORMAL_AND_FUTURE_IMPORTS)
def test_only_normal_imports(): check_on_input(*ONLY_NORMAL_IMPORTS)
def test_only_future_imports(): check_on_input(*ONLY_FUTURE_IMPORTS)
def test_no_imports(): check_on_input(*NO_IMPORTS)
def test_next_nested(): check_on_input(*NEXT_NESTED)
def test_future_import_as(): check_on_input(*FUTURE_IMPORT_AS)
def test_dict_in_loop(): check_on_input(*DICT_IN_LOOP)
def test_raise_value(): check_on_input(*RAISE_VALUE)
def test_unicode_six(): check_on_input(UNICODE_LITERALS, UNICODE_LITERALS_six, extra_flags=['--six-unicode'])
def test_unicode_type_ref(): check_on_input(*UNICODE_TYPE_REF)
def test_unicode_compat(): check_on_input(UNICODE_LITERALS, UNICODE_LITERALS_compat)
def test_map_1_arg(): check_on_input(*MAP_1_ARG)
def test_unicode_future(): check_on_input(UNICODE_LITERALS, UNICODE_LITERALS_future, extra_flags=['--future-unicode'])
def test_map_lambda(): check_on_input(*MAP_LAMBDA)
def test_open(): check_on_input(OPEN[0].format('open'), OPEN[1], extra_flags=['-f', 'libmodernize.fixes.fix_open'])
def test_future_import_as_multiple(): check_on_input(*FUTURE_IMPORT_AS_MULTIPLE)
def test_open_optional(): check_on_input(OPEN[0].format('open'), OPEN[0].format('open'))
def test_urllib_multi_import(): check_on_input(*URLLIB_MULTI_IMPORT_REFERENCE)
def test_file(): flags = ['-f', 'libmodernize.fixes.fix_open', '-f', 'libmodernize.fixes.fix_file'] check_on_input(OPEN[0].format('file'), OPEN[1], extra_flags=flags)
def test_urllib_invalid_imports(): check_on_input(*URLIB_INVALID_CODE)
def test_raise_traceback(): check_on_input(*RAISE_TRACEBACK)
def test_future_import_paren(): check_on_input(*FUTURE_IMPORT_PAREN)
def test_input(): check_on_input(*INPUT)
def test_raise_exc(): check_on_input(*RAISE_EXC)
def test_input_args(): check_on_input(*INPUT_ARGS)
def test_raise_tuple(): check_on_input(*RAISE_TUPLE)
def test_raw_input_trailer(): check_on_input(*RAW_INPUT_TRAILER)
def test_raise_tuple_args(): check_on_input(*RAISE_TUPLE_ARGS)
def test_raw_input_input(): check_on_input(*RAW_INPUT_INPUT)
def test_metaclass_no_base_parens(): check_on_input(*METACLASS_NO_BASE_PARENS)
def test_new_division(): check_on_input( *NEW_DIVISION, extra_flags=["-f", "libmodernize.fixes.fix_classic_division"] )
def test_metaclass_single_base(): check_on_input(*METACLASS_SINGLE_BASE)
def test_map_4_args(): check_on_input(*MAP_4_ARGS)
def test_metaclass_many_bases(): check_on_input(*METACLASS_MANY_BASES)
def test_map_iterator_context(): check_on_input(*MAP_ITERATOR_CONTEXT)
def test_metaclass_one_liner(): check_on_input(*METACLASS_ONE_LINER)
def test_urllib_module_reference(): check_on_input(*URLLIB_MODULE_REFERENCE)
def test_urllib_function_reference(): check_on_input(*URLLIB_FUNCTION_REFERENCE)
def test_file_ref(): check_on_input(*FILE_REF)