Ejemplo n.º 1
0
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)
Ejemplo n.º 3
0
def test_next_method():
    check_on_input(*NEXT_METHOD)
Ejemplo n.º 4
0
def test_unicode_type_call():
    check_on_input(*UNICODE_TYPE_CALL)
Ejemplo n.º 5
0
def test_map_ref():
    check_on_input(*MAP_REF)
Ejemplo n.º 6
0
def test_optional():
    check_on_input(CLASSIC_DIVISION[0], CLASSIC_DIVISION[0])
Ejemplo n.º 7
0
def test_raise_string():
    check_on_input(*RAISE_STRING)
Ejemplo n.º 8
0
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_))
Ejemplo n.º 10
0
def test_normal_and_future_imports():
    check_on_input(*NORMAL_AND_FUTURE_IMPORTS)
Ejemplo n.º 11
0
def test_only_normal_imports():
    check_on_input(*ONLY_NORMAL_IMPORTS)
Ejemplo n.º 12
0
def test_only_future_imports():
    check_on_input(*ONLY_FUTURE_IMPORTS)
Ejemplo n.º 13
0
def test_no_imports():
    check_on_input(*NO_IMPORTS)
Ejemplo n.º 14
0
def test_next_nested():
    check_on_input(*NEXT_NESTED)
Ejemplo n.º 15
0
def test_next_method():
    check_on_input(*NEXT_METHOD)
Ejemplo n.º 16
0
def test_future_import_as():
    check_on_input(*FUTURE_IMPORT_AS)
def test_dict_in_loop():
    check_on_input(*DICT_IN_LOOP)
Ejemplo n.º 18
0
def test_raise_value():
    check_on_input(*RAISE_VALUE)
Ejemplo n.º 19
0
def test_unicode_six():
    check_on_input(UNICODE_LITERALS, UNICODE_LITERALS_six, extra_flags=['--six-unicode'])
Ejemplo n.º 20
0
def test_unicode_type_ref():
    check_on_input(*UNICODE_TYPE_REF)
Ejemplo n.º 21
0
def test_unicode_compat():
    check_on_input(UNICODE_LITERALS, UNICODE_LITERALS_compat)
Ejemplo n.º 22
0
def test_map_1_arg():
    check_on_input(*MAP_1_ARG)
Ejemplo n.º 23
0
def test_unicode_future():
    check_on_input(UNICODE_LITERALS, UNICODE_LITERALS_future, extra_flags=['--future-unicode'])
Ejemplo n.º 24
0
def test_map_lambda():
    check_on_input(*MAP_LAMBDA)
Ejemplo n.º 25
0
def test_open():
    check_on_input(OPEN[0].format('open'), OPEN[1],
                   extra_flags=['-f', 'libmodernize.fixes.fix_open'])
Ejemplo n.º 26
0
def test_future_import_as_multiple():
    check_on_input(*FUTURE_IMPORT_AS_MULTIPLE)
Ejemplo n.º 27
0
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)
Ejemplo n.º 29
0
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)
Ejemplo n.º 31
0
def test_raise_traceback():
    check_on_input(*RAISE_TRACEBACK)
Ejemplo n.º 32
0
def test_next_nested():
    check_on_input(*NEXT_NESTED)
def test_future_import_paren():
    check_on_input(*FUTURE_IMPORT_PAREN)
Ejemplo n.º 34
0
def test_future_import_as_multiple():
    check_on_input(*FUTURE_IMPORT_AS_MULTIPLE)
def test_input():
    check_on_input(*INPUT)
Ejemplo n.º 36
0
def test_raise_exc():
    check_on_input(*RAISE_EXC)
def test_input_args():
    check_on_input(*INPUT_ARGS)
Ejemplo n.º 38
0
def test_raise_tuple():
    check_on_input(*RAISE_TUPLE)
def test_raw_input_trailer():
    check_on_input(*RAW_INPUT_TRAILER)
Ejemplo n.º 40
0
def test_raise_tuple_args():
    check_on_input(*RAISE_TUPLE_ARGS)
def test_raw_input_input():
    check_on_input(*RAW_INPUT_INPUT)
Ejemplo n.º 42
0
def test_unicode_type_call():
    check_on_input(*UNICODE_TYPE_CALL)
Ejemplo n.º 43
0
def test_metaclass_no_base_parens():
    check_on_input(*METACLASS_NO_BASE_PARENS)
Ejemplo n.º 44
0
def test_new_division():
    check_on_input(
        *NEW_DIVISION, extra_flags=["-f", "libmodernize.fixes.fix_classic_division"]
    )
Ejemplo n.º 45
0
def test_metaclass_single_base():
    check_on_input(*METACLASS_SINGLE_BASE)
Ejemplo n.º 46
0
def test_map_4_args():
    check_on_input(*MAP_4_ARGS)
Ejemplo n.º 47
0
def test_metaclass_many_bases():
    check_on_input(*METACLASS_MANY_BASES)
Ejemplo n.º 48
0
def test_map_iterator_context():
    check_on_input(*MAP_ITERATOR_CONTEXT)
Ejemplo n.º 49
0
def test_metaclass_one_liner():
    check_on_input(*METACLASS_ONE_LINER)
Ejemplo n.º 50
0
def test_unicode_type_ref():
    check_on_input(*UNICODE_TYPE_REF)
def test_urllib_module_reference():
    check_on_input(*URLLIB_MODULE_REFERENCE)
Ejemplo n.º 52
0
def test_future_import_as():
    check_on_input(*FUTURE_IMPORT_AS)
def test_urllib_function_reference():
    check_on_input(*URLLIB_FUNCTION_REFERENCE)
Ejemplo n.º 54
0
def test_future_import_paren():
    check_on_input(*FUTURE_IMPORT_PAREN)
Ejemplo n.º 55
0
def test_file_ref():
    check_on_input(*FILE_REF)