diff --git a/libcst/_nodes/_expression.py b/libcst/_nodes/_expression.py index 34599ac2..cd0b3b86 100644 --- a/libcst/_nodes/_expression.py +++ b/libcst/_nodes/_expression.py @@ -763,7 +763,7 @@ class FormattedString(_BasePrefixedString): start: str = 'f"' #: The trailing quote. This must match the type of quote used in ``start``. - end: str = '"' + end: Literal['"', "'", '"""', "'''"] = '"' lpar: Sequence[LeftParen] = () #: Sequence of parenthesis for precidence dictation. diff --git a/libcst/_nodes/tests/test_atom.py b/libcst/_nodes/tests/test_atom.py index c780cf60..e12f2d2c 100644 --- a/libcst/_nodes/tests/test_atom.py +++ b/libcst/_nodes/tests/test_atom.py @@ -839,12 +839,6 @@ class AtomTest(CSTNodeTest): ), "expected_re": "must have matching enclosing quotes", }, - { - "get_node": ( - lambda: cst.FormattedString(start="f'''", parts=(), end="''") - ), - "expected_re": "must have matching enclosing quotes", - }, { "get_node": ( lambda: cst.ConcatenatedString(