| 238 | |
| 239 | |
| 240 | def test_logical_line_plugin(tmpdir, capsys): |
| 241 | cfg_s = f"""\ |
| 242 | [flake8] |
| 243 | extend-ignore = F |
| 244 | [flake8:local-plugins] |
| 245 | extension = |
| 246 | T = {yields_logical_line.__module__}:{yields_logical_line.__name__} |
| 247 | """ |
| 248 | |
| 249 | cfg = tmpdir.join("tox.ini") |
| 250 | cfg.write(cfg_s) |
| 251 | |
| 252 | src = """\ |
| 253 | f'hello world' |
| 254 | """ |
| 255 | t_py = tmpdir.join("t.py") |
| 256 | t_py.write_binary(src.encode()) |
| 257 | |
| 258 | with tmpdir.as_cwd(): |
| 259 | assert main(("t.py", "--config", str(cfg))) == 1 |
| 260 | |
| 261 | expected = """\ |
| 262 | t.py:1:1: T001 "f'xxxxxxxxxxx'" |
| 263 | """ |
| 264 | out, err = capsys.readouterr() |
| 265 | assert out == expected |
| 266 | |
| 267 | |
| 268 | def test_escaping_of_fstrings_in_string_redacter(tmpdir, capsys): |