| 300 | |
| 301 | @pytest.mark.xfail(sys.version_info < (3, 14), reason="3.14+") |
| 302 | def test_tstring_logical_line(tmpdir, capsys): # pragma: >=3.14 cover |
| 303 | cfg_s = f"""\ |
| 304 | [flake8] |
| 305 | extend-ignore = F |
| 306 | [flake8:local-plugins] |
| 307 | extension = |
| 308 | T = {yields_logical_line.__module__}:{yields_logical_line.__name__} |
| 309 | """ |
| 310 | |
| 311 | cfg = tmpdir.join("tox.ini") |
| 312 | cfg.write(cfg_s) |
| 313 | |
| 314 | src = """\ |
| 315 | t''' |
| 316 | hello {world} |
| 317 | ''' |
| 318 | t'{{"{hello}": "{world}"}}' |
| 319 | """ |
| 320 | t_py = tmpdir.join("t.py") |
| 321 | t_py.write_binary(src.encode()) |
| 322 | |
| 323 | with tmpdir.as_cwd(): |
| 324 | assert main(("t.py", "--config", str(cfg))) == 1 |
| 325 | |
| 326 | expected = """\ |
| 327 | t.py:1:1: T001 "t'''xxxxxxx{world}x'''" |
| 328 | t.py:4:1: T001 "t'xxx{hello}xxxx{world}xxx'" |
| 329 | """ |
| 330 | out, err = capsys.readouterr() |
| 331 | assert out == expected |