Skip to content

Commit 93a6539

Browse files
committed
Stop printing whole pytest traceback on error
1 parent 9efc242 commit 93a6539

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pytest_ruff/__init__.py

+5
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,11 @@ def format_file(path):
103103
raise RuffError("File would be reformatted")
104104

105105

106+
def pytest_exception_interact(node, call, report):
107+
if isinstance(call.excinfo.value, RuffError):
108+
report.longrepr = str(call.excinfo.value)
109+
110+
106111
class RuffItem(pytest.Item):
107112
name = "ruff"
108113

0 commit comments

Comments
 (0)