Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

f-string parser: Fix error messages for test_conversions #159

Open
pablogsal opened this issue Oct 9, 2021 · 0 comments
Open

f-string parser: Fix error messages for test_conversions #159

pablogsal opened this issue Oct 9, 2021 · 0 comments

Comments

@pablogsal
Copy link

In test_fstring the test_conversions test is failing due to what seems a mismatched error message but it may very well be a problem in the tokenizer. We need to investigate and either fix the tokenizer or update the test error messages. Example failure:

FAIL: test_conversions (test.test_fstring.TestCase) (str="f'{3!ss:s}'")\n----------------------------------------------------------------------
  File "<string>", line 1
    f'{3!ss:s}'
         ^
SyntaxError: Invalid conversion character

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 "Invalid conversion character (<string>, line 1)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant