Skip to content

f-string parser: Update parentheses errors #158

@pablogsal

Description

@pablogsal

There is a bunch of tests that fail because the tokenizer error for mismatched parentheses is different. For example:

FAIL: test_compile_time_concat (test.test_fstring.TestCase) (str="f'{3' f'}'")\n----------------------------------------------------------------------
  File "<string>", line 1
    f'{3' f'}'
        ^
SyntaxError: expected '}'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/pablogsal/github/python/f-string-grammar/Lib/test/test_fstring.py", line 32, in assertAllRaise
    with self.assertRaisesRegex(exception_type, regex):
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: "f-string: expecting '}'" does not match "expected '}' (<string>, line 1)"

we need to update these tests.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions