diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/unit/test_exceptions.py | 1 | ||||
| -rw-r--r-- | tests/unit/test_file_checker.py | 7 |
2 files changed, 7 insertions, 1 deletions
diff --git a/tests/unit/test_exceptions.py b/tests/unit/test_exceptions.py index 06c5179..96d0244 100644 --- a/tests/unit/test_exceptions.py +++ b/tests/unit/test_exceptions.py @@ -18,6 +18,7 @@ from flake8 import exceptions exception=ValueError("boom!"), ), exceptions.PluginExecutionFailed( + filename="filename.py", plugin_name="plugin_name", exception=ValueError("boom!"), ), diff --git a/tests/unit/test_file_checker.py b/tests/unit/test_file_checker.py index ee4f745..3fe2e51 100644 --- a/tests/unit/test_file_checker.py +++ b/tests/unit/test_file_checker.py @@ -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 |
