Exemplo n.º 1
0
def test_fix_oserror_aliases_try(alias, tpl, expected):
    s = tpl.format(alias=alias)
    ret = _fix_plugins(s, settings=Settings(min_version=(3, )))
    assert ret == expected
Exemplo n.º 2
0
def test_fix_pep604_types_noop(s, version):
    assert _fix_plugins(s, settings=Settings(min_version=version)) == s
Exemplo n.º 3
0
def test_fix_py3_only_code(s, expected):
    ret = _fix_plugins(s, settings=Settings(min_version=(3,)))
    assert ret == expected
Exemplo n.º 4
0
def test_fix_typing_text_noop(s, version):
    assert _fix_plugins(s, settings=Settings(min_version=version)) == s
Exemplo n.º 5
0
def test_fix_pep604_types(s, expected):
    assert _fix_plugins(s, settings=Settings(min_version=(3, 10))) == expected
Exemplo n.º 6
0
def test_sets_generators_trailing_commas(s, expected):
    ret = _fix_plugins(s, settings=Settings())
    assert ret == expected
Exemplo n.º 7
0
def test_sets(s, expected):
    ret = _fix_plugins(s, settings=Settings())
    assert ret == expected
Exemplo n.º 8
0
def test_fix_no_arg_decorators(s, expected):
    ret = _fix_plugins(s, settings=Settings(min_version=(3, 8)))
    assert ret == expected
Exemplo n.º 9
0
def test_fix_mock(s, expected):
    assert _fix_plugins(s, settings=Settings(min_version=(3,))) == expected
Exemplo n.º 10
0
def test_fix_native_literals(s, expected):
    ret = _fix_plugins(s, settings=Settings(min_version=(3, )))
    assert ret == expected
Exemplo n.º 11
0
def test_fix_no_arg_decorators_noop(s, min_version):
    assert _fix_plugins(s, settings=Settings(min_version=min_version)) == s
Exemplo n.º 12
0
def test_fix_native_literals_noop(s):
    assert _fix_plugins(s, settings=Settings(min_version=(3, ))) == s
Exemplo n.º 13
0
def test_fix_generator_expressions(s, expected):
    ret = _fix_plugins(s, settings=Settings())
    assert ret == expected
Exemplo n.º 14
0
def test_fix_generator_expressions_noop(s):
    assert _fix_plugins(s, settings=Settings()) == s
Exemplo n.º 15
0
def test_percent_format_noop_if_bug_16806():
    s = '"""%s\n""" % ("issue16806",)'
    assert _fix_plugins(s, settings=Settings()) == s
Exemplo n.º 16
0
def test_c_element_tree_noop(s, version):
    assert _fix_plugins(s, settings=Settings(min_version=version)) == s
Exemplo n.º 17
0
def test_percent_format_todo(s, expected):
    ret = _fix_plugins(s, settings=Settings())
    assert ret == expected
Exemplo n.º 18
0
def test_fix_c_element_tree(s, expected):
    assert _fix_plugins(s, settings=Settings(min_version=(3,))) == expected
Exemplo n.º 19
0
def test_fix_sets_noop(s):
    assert _fix_plugins(s, settings=Settings()) == s
Exemplo n.º 20
0
def test_fix_base_classes(s, expected):
    ret = _fix_plugins(s, settings=Settings(min_version=(3,)))
    assert ret == expected
Exemplo n.º 21
0
def test_fix_generic_types(s, expected):
    ret = _fix_plugins(s, settings=Settings(min_version=(3, 9)))
    assert ret == expected
Exemplo n.º 22
0
def test_replaced_for_minimum_version():
    ret = _fix_plugins('x: "int"', settings=Settings(min_version=(3, 11)))
    assert ret == 'x: int'
Exemplo n.º 23
0
def test_fix_typing_text(s, expected):
    ret = _fix_plugins(s, settings=Settings(min_version=(3, )))
    assert ret == expected
Exemplo n.º 24
0
def test_fix_six_remove_decorators(s, expected):
    ret = _fix_plugins(s, settings=Settings(min_version=(3, )))
    assert ret == expected
Exemplo n.º 25
0
def test_fix_generic_types_future_annotations(s, expected):
    assert _fix_plugins(s, settings=Settings(min_version=(3,))) == expected
Exemplo n.º 26
0
def test_fix_encode_noop(s):
    assert _fix_plugins(s, settings=Settings(min_version=(3, ))) == s
Exemplo n.º 27
0
def test_fix_py2_blocks(s, expected):
    ret = _fix_plugins(s, settings=Settings(min_version=(3,)))
    assert ret == expected
Exemplo n.º 28
0
def test_percent_format_noop(s):
    assert _fix_plugins(s, settings=Settings()) == s
Exemplo n.º 29
0
def test_fix_py2_block_noop(s):
    assert _fix_plugins(s, settings=Settings(min_version=(3,))) == s
Exemplo n.º 30
0
def test_fix_oserror_complex_aliases_raise(imp, tpl, expected_tpl):
    s, expected = tpl.format(imp=imp), expected_tpl.format(imp=imp)
    ret = _fix_plugins(s, settings=Settings(min_version=(3, )))
    assert ret == expected