Skip to content

Commit

Permalink
Drop a test that has not been used since it was committed
Browse files Browse the repository at this point in the history
This test has been dead code since its introduction and does not get
executed by pytest due to starting with `text` rather than `test`. The
underlying data for this test is also non-trivial to update and
dependent on the specific Python version.

Since this is already dead code and is non-trivial to update, removing
this test more clearly reflects what happens with this dead code in
tests and prevents potential confusion due to its presence.
  • Loading branch information
pradyunsg committed Apr 7, 2024
1 parent 0d7e598 commit 3bf4e2c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 23 deletions.
1 change: 0 additions & 1 deletion tests/_exception_render.py

This file was deleted.

22 changes: 0 additions & 22 deletions tests/test_traceback.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,6 @@
from rich.theme import Theme
from rich.traceback import Traceback, install

# from .render import render

try:
from ._exception_render import expected
except ImportError:
expected = None


CAPTURED_EXCEPTION = 'Traceback (most recent call last):\n╭──────────────────────────────────────────────────────────────────────────────────────────────────╮\n│ File "/Users/textualize/projects/rich/tests/test_traceback.py", line 26, in test_handler │\n│ 23 try: │\n│ 24 old_handler = install(console=console, line_numbers=False) │\n│ 25 try: │\n│ ❱ 26 1 / 0 │\n│ 27 except Exception: │\n│ 28 exc_type, exc_value, traceback = sys.exc_info() │\n│ 29 sys.excepthook(exc_type, exc_value, traceback) │\n╰──────────────────────────────────────────────────────────────────────────────────────────────────╯\nZeroDivisionError: division by zero\n'


Expand Down Expand Up @@ -70,11 +62,6 @@ def level2():
assert old_handler == expected_old_handler


def text_exception_render():
exc_render = render(get_exception())
assert exc_render == expected


def test_capture():
try:
1 / 0
Expand Down Expand Up @@ -342,12 +329,3 @@ def level3():
assert len(frames) == expected_frames_length
frame_names = [f.name for f in frames]
assert frame_names == expected_frame_names


if __name__ == "__main__": # pragma: no cover
expected = render(get_exception())

with open("_exception_render.py", "wt") as fh:
exc_render = render(get_exception())
print(exc_render)
fh.write(f"expected={exc_render!r}")

0 comments on commit 3bf4e2c

Please sign in to comment.