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
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
def test_fix_typing_text_noop(s, version): assert _fix_plugins(s, settings=Settings(min_version=version)) == s
def test_fix_pep604_types(s, expected): assert _fix_plugins(s, settings=Settings(min_version=(3, 10))) == expected
def test_sets_generators_trailing_commas(s, expected): ret = _fix_plugins(s, settings=Settings()) assert ret == expected
def test_sets(s, expected): ret = _fix_plugins(s, settings=Settings()) assert ret == expected
def test_fix_no_arg_decorators(s, expected): ret = _fix_plugins(s, settings=Settings(min_version=(3, 8))) assert ret == expected
def test_fix_mock(s, expected): assert _fix_plugins(s, settings=Settings(min_version=(3,))) == expected
def test_fix_native_literals(s, expected): ret = _fix_plugins(s, settings=Settings(min_version=(3, ))) assert ret == expected
def test_fix_no_arg_decorators_noop(s, min_version): assert _fix_plugins(s, settings=Settings(min_version=min_version)) == s
def test_fix_native_literals_noop(s): assert _fix_plugins(s, settings=Settings(min_version=(3, ))) == s
def test_fix_generator_expressions(s, expected): ret = _fix_plugins(s, settings=Settings()) assert ret == expected
def test_fix_generator_expressions_noop(s): assert _fix_plugins(s, settings=Settings()) == s
def test_percent_format_noop_if_bug_16806(): s = '"""%s\n""" % ("issue16806",)' assert _fix_plugins(s, settings=Settings()) == s
def test_c_element_tree_noop(s, version): assert _fix_plugins(s, settings=Settings(min_version=version)) == s
def test_percent_format_todo(s, expected): ret = _fix_plugins(s, settings=Settings()) assert ret == expected
def test_fix_c_element_tree(s, expected): assert _fix_plugins(s, settings=Settings(min_version=(3,))) == expected
def test_fix_sets_noop(s): assert _fix_plugins(s, settings=Settings()) == s
def test_fix_base_classes(s, expected): ret = _fix_plugins(s, settings=Settings(min_version=(3,))) assert ret == expected
def test_fix_generic_types(s, expected): ret = _fix_plugins(s, settings=Settings(min_version=(3, 9))) assert ret == expected
def test_replaced_for_minimum_version(): ret = _fix_plugins('x: "int"', settings=Settings(min_version=(3, 11))) assert ret == 'x: int'
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
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
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
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