Home - Summaries: (main) : (py3.11) : Everything - Nightly builds - Benchmarks - RPython - Builders - About

pypy/interpreter/pyparser/test/test_pytokenizer.py::test_f_string[format specifier bug 2]

source = "f'result: {value:{width:0}.{precision:1}}'\n"
expected = [(7, "f'", 1, 0, 1, 2), (8, 'result: ', 1, 2, 1, 10), (29, '{', 1, 10, 1, 11), (1, 'value', 1, 11, 1, 16), (14, ':', 1, 16, 1, 17), (8, '', 1, 17, 1, 17), ...]

    @_parametrize("source, expected", _fstring_tests)
    def test_f_string(source, expected):
        lines = source.splitlines(True)
        tks = tokenize(source)
        assert tks[: len(expected)] == [
            Token(
                tk_type,
                value,
                lineno,
                col_offset,
                lines[end_lineno - 1],
                end_lineno,
                end_col_offset,
            )
>           for tk_type, value, lineno, col_offset, end_lineno, end_col_offset in expected
        ]
E       assert [Token(FSTRIN...RACE, {), ...] == [Token(FSTRING...IDDLE, ), ...]
E         At index 5 diff: Token(LBRACE, {) != Token(FSTRING_MIDDLE, )
E         Use -v to get the full diff

interpreter/pyparser/test/test_pytokenizer.py:796: AssertionError
builder: own-linux-x86-64 build #10880+
test: pypy/interpreter/pyparser/test/test_pytokenizer.py::test_f_string[format specifier bug 2]