Skip to content

Commit

Permalink
Stop printing whole pytest traceback on error (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
lexi-k committed Apr 11, 2024
1 parent 9efc242 commit cb1685e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pytest_ruff/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,11 @@ def format_file(path):
raise RuffError("File would be reformatted")


def pytest_exception_interact(node, call, report):
if isinstance(call.excinfo.value, RuffError):
report.longrepr = str(call.excinfo.value)


class RuffItem(pytest.Item):
name = "ruff"

Expand Down

0 comments on commit cb1685e

Please sign in to comment.