MCPcopy
hub / github.com/PyCQA/flake8 / test_logical_line_plugin

Function test_logical_line_plugin

tests/integration/test_plugins.py:240–265  ·  view source on GitHub ↗
(tmpdir, capsys)

Source from the content-addressed store, hash-verified

238
239
240def test_logical_line_plugin(tmpdir, capsys):
241 cfg_s = f"""\
242[flake8]
243extend-ignore = F
244[flake8:local-plugins]
245extension =
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 = """\
253f'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 = """\
262t.py:1:1: T001 "f'xxxxxxxxxxx'"
263"""
264 out, err = capsys.readouterr()
265 assert out == expected
266
267
268def test_escaping_of_fstrings_in_string_redacter(tmpdir, capsys):

Callers

nothing calls this directly

Calls 2

mainFunction · 0.90
writeMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…