mirror of
https://github.com/PyCQA/flake8.git
synced 2026-03-29 10:36:53 +00:00
include the file path in the plugin execution error
This commit is contained in:
parent
9de288a22f
commit
d2333c4471
4 changed files with 24 additions and 9 deletions
|
|
@ -18,6 +18,7 @@ from flake8 import exceptions
|
|||
exception=ValueError("boom!"),
|
||||
),
|
||||
exceptions.PluginExecutionFailed(
|
||||
filename="filename.py",
|
||||
plugin_name="plugin_name",
|
||||
exception=ValueError("boom!"),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -54,5 +54,10 @@ def test_raises_exception_on_failed_plugin(tmp_path, default_options):
|
|||
plugins=finder.Checkers([], [], []),
|
||||
options=default_options,
|
||||
)
|
||||
with pytest.raises(flake8.exceptions.PluginExecutionFailed):
|
||||
with pytest.raises(flake8.exceptions.PluginExecutionFailed) as excinfo:
|
||||
fchecker.run_check(plugin)
|
||||
expected = (
|
||||
f'{fname}: "plugin-name[X]" failed during execution '
|
||||
f"due to ValueError()"
|
||||
)
|
||||
assert str(excinfo.value) == expected
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue