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
Example #2
0
def test_fix_pep604_types_noop(s, version):
    assert _fix_plugins(s, settings=Settings(min_version=version)) == s
def test_fix_py3_only_code(s, expected):
    ret = _fix_plugins(s, settings=Settings(min_version=(3,)))
    assert ret == expected
Example #4
0
def test_fix_typing_text_noop(s, version):
    assert _fix_plugins(s, settings=Settings(min_version=version)) == s
Example #5
0
def test_fix_pep604_types(s, expected):
    assert _fix_plugins(s, settings=Settings(min_version=(3, 10))) == expected
Example #6
0
def test_sets_generators_trailing_commas(s, expected):
    ret = _fix_plugins(s, settings=Settings())
    assert ret == expected
Example #7
0
def test_sets(s, expected):
    ret = _fix_plugins(s, settings=Settings())
    assert ret == expected
Example #8
0
def test_fix_no_arg_decorators(s, expected):
    ret = _fix_plugins(s, settings=Settings(min_version=(3, 8)))
    assert ret == expected
Example #9
0
def test_fix_mock(s, expected):
    assert _fix_plugins(s, settings=Settings(min_version=(3,))) == expected
Example #10
0
def test_fix_native_literals(s, expected):
    ret = _fix_plugins(s, settings=Settings(min_version=(3, )))
    assert ret == expected
Example #11
0
def test_fix_no_arg_decorators_noop(s, min_version):
    assert _fix_plugins(s, settings=Settings(min_version=min_version)) == s
Example #12
0
def test_fix_native_literals_noop(s):
    assert _fix_plugins(s, settings=Settings(min_version=(3, ))) == s
Example #13
0
def test_fix_generator_expressions(s, expected):
    ret = _fix_plugins(s, settings=Settings())
    assert ret == expected
Example #14
0
def test_fix_generator_expressions_noop(s):
    assert _fix_plugins(s, settings=Settings()) == s
Example #15
0
def test_percent_format_noop_if_bug_16806():
    s = '"""%s\n""" % ("issue16806",)'
    assert _fix_plugins(s, settings=Settings()) == s
Example #16
0
def test_c_element_tree_noop(s, version):
    assert _fix_plugins(s, settings=Settings(min_version=version)) == s
Example #17
0
def test_percent_format_todo(s, expected):
    ret = _fix_plugins(s, settings=Settings())
    assert ret == expected
Example #18
0
def test_fix_c_element_tree(s, expected):
    assert _fix_plugins(s, settings=Settings(min_version=(3,))) == expected
Example #19
0
def test_fix_sets_noop(s):
    assert _fix_plugins(s, settings=Settings()) == s
Example #20
0
def test_fix_base_classes(s, expected):
    ret = _fix_plugins(s, settings=Settings(min_version=(3,)))
    assert ret == expected
Example #21
0
def test_fix_generic_types(s, expected):
    ret = _fix_plugins(s, settings=Settings(min_version=(3, 9)))
    assert ret == expected
Example #22
0
def test_replaced_for_minimum_version():
    ret = _fix_plugins('x: "int"', settings=Settings(min_version=(3, 11)))
    assert ret == 'x: int'
Example #23
0
def test_fix_typing_text(s, expected):
    ret = _fix_plugins(s, settings=Settings(min_version=(3, )))
    assert ret == expected
def test_fix_six_remove_decorators(s, expected):
    ret = _fix_plugins(s, settings=Settings(min_version=(3, )))
    assert ret == expected
Example #25
0
def test_fix_generic_types_future_annotations(s, expected):
    assert _fix_plugins(s, settings=Settings(min_version=(3,))) == expected
def test_fix_encode_noop(s):
    assert _fix_plugins(s, settings=Settings(min_version=(3, ))) == s
def test_fix_py2_blocks(s, expected):
    ret = _fix_plugins(s, settings=Settings(min_version=(3,)))
    assert ret == expected
Example #28
0
def test_percent_format_noop(s):
    assert _fix_plugins(s, settings=Settings()) == s
def test_fix_py2_block_noop(s):
    assert _fix_plugins(s, settings=Settings(min_version=(3,))) == s
Example #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