Beispiel #1
0
def test_fix_fstrings_noop(s):
    assert _fix_py36_plus(s) == s
Beispiel #2
0
def test_fix_fstrings(s, expected):
    assert _fix_py36_plus(s) == expected
def test_fix_typing_named_tuple(s, expected):
    assert _fix_py36_plus(s) == expected
def test_typing_named_tuple_noop(s):
    assert _fix_py36_plus(s) == s
def test_typing_typed_dict(s, expected):
    assert _fix_py36_plus(s) == expected
def test_typing_typed_dict_noop(s):
    assert _fix_py36_plus(s) == s
def test_fix_typing_named_tuple(s, expected):
    assert _fix_py36_plus(s, min_version=(3, 6)) == expected
def test_typing_named_tuple_noop(s):
    assert _fix_py36_plus(s, min_version=(3, 6)) == s
Beispiel #9
0
def test_typing_typed_dict_noop(s):
    assert _fix_py36_plus(s, min_version=(3, 6)) == s
Beispiel #10
0
def test_typing_typed_dict(s, expected):
    assert _fix_py36_plus(s, min_version=(3, 6)) == expected
Beispiel #11
0
def test_fix_fstrings_await_py37():
    s = "async def c(): return '{}'.format(await 1+foo())"
    expected = "async def c(): return f'{await 1+foo()}'"
    assert _fix_py36_plus(s, min_version=(3, 7)) == expected
Beispiel #12
0
def test_fix_fstrings(s, expected):
    assert _fix_py36_plus(s, min_version=(3, 6)) == expected
Beispiel #13
0
def test_fix_fstrings_noop(s):
    assert _fix_py36_plus(s, min_version=(3, 6)) == s