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

Function test_start

tests/unit/test_base_formatter.py:24–34  ·  view source on GitHub ↗

Verify we open a new file in the start method.

(filename)

Source from the content-addressed store, hash-verified

22
23@pytest.mark.parametrize("filename", [None, "out.txt"])
24def test_start(filename):
25 """Verify we open a new file in the start method."""
26 mock_open = mock.mock_open()
27 formatter = base.BaseFormatter(options(output_file=filename))
28 with mock.patch("flake8.formatting.base.open", mock_open):
29 formatter.start()
30
31 if filename is None:
32 assert mock_open.called is False
33 else:
34 mock_open.assert_called_once_with(filename, "a")
35
36
37def test_stop():

Callers

nothing calls this directly

Calls 2

startMethod · 0.95
optionsFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…