diff --git a/examples/exception.py b/examples/exception.py index 548432d669..6c693df2e8 100644 --- a/examples/exception.py +++ b/examples/exception.py @@ -34,7 +34,7 @@ def divide_all(divides: List[Tuple[float, float]]) -> None: (0, 1000000), (3.1427, 2), (888, 0), - (2 ** 32, 2 ** 16), + (2**32, 2**16), ] divide_all(DIVIDES) diff --git a/examples/top_lite_simulator.py b/examples/top_lite_simulator.py index 4fecaaa8b8..147cbb0f96 100644 --- a/examples/top_lite_simulator.py +++ b/examples/top_lite_simulator.py @@ -53,7 +53,6 @@ def generate_process(pid: int) -> Process: def create_process_table(height: int) -> Table: - processes = sorted( [generate_process(pid) for pid in range(height)], key=lambda p: p.cpu_percent, diff --git a/rich/__main__.py b/rich/__main__.py index 1ed4d32273..781e7e162a 100644 --- a/rich/__main__.py +++ b/rich/__main__.py @@ -214,7 +214,6 @@ def iter_last(values: Iterable[T]) -> Iterable[Tuple[bool, T]]: if __name__ == "__main__": # pragma: no cover - console = Console( file=io.StringIO(), force_terminal=True, diff --git a/rich/_ratio.py b/rich/_ratio.py index f7dbe92705..e12397af6f 100644 --- a/rich/_ratio.py +++ b/rich/_ratio.py @@ -151,7 +151,6 @@ def ratio_distribute( @dataclass class E: - size: Optional[int] = None ratio: int = 1 minimum_size: int = 1 diff --git a/rich/_windows.py b/rich/_windows.py index bac88e639b..de890e14fe 100644 --- a/rich/_windows.py +++ b/rich/_windows.py @@ -24,7 +24,6 @@ class WindowsConsoleFeatures: windll = None raise ImportError("Not windows") except (AttributeError, ImportError, ValueError): - # Fallback if we can't load the Windows DLL def get_windows_console_features() -> WindowsConsoleFeatures: features = WindowsConsoleFeatures() @@ -32,7 +31,6 @@ def get_windows_console_features() -> WindowsConsoleFeatures: else: - STDOUT = -11 ENABLE_VIRTUAL_TERMINAL_PROCESSING = 4 _GetConsoleMode = windll.kernel32.GetConsoleMode diff --git a/rich/bar.py b/rich/bar.py index ed86a552d1..022284b578 100644 --- a/rich/bar.py +++ b/rich/bar.py @@ -48,7 +48,6 @@ def __repr__(self) -> str: def __rich_console__( self, console: Console, options: ConsoleOptions ) -> RenderResult: - width = min( self.width if self.width is not None else options.max_width, options.max_width, diff --git a/rich/box.py b/rich/box.py index de79f05932..6b87ca4eeb 100644 --- a/rich/box.py +++ b/rich/box.py @@ -431,7 +431,6 @@ def get_bottom(self, widths: Iterable[int]) -> str: if __name__ == "__main__": # pragma: no cover - from rich.columns import Columns from rich.panel import Panel diff --git a/rich/cells.py b/rich/cells.py index 7f9c0c16c9..2ec1abdcd8 100644 --- a/rich/cells.py +++ b/rich/cells.py @@ -124,10 +124,16 @@ def chop_cells(text: str, max_size: int, position: int = 0) -> List[str]: if __name__ == "__main__": # pragma: no cover - print(get_character_cell_size("๐Ÿ˜ฝ")) - for line in chop_cells("""่ฟ™ๆ˜ฏๅฏนไบšๆดฒ่ฏญ่จ€ๆ”ฏๆŒ็š„ๆต‹่ฏ•ใ€‚้ขๅฏนๆจกๆฃฑไธคๅฏ็š„ๆƒณๆณ•๏ผŒๆ‹’็ป็Œœๆต‹็š„่ฏฑๆƒ‘ใ€‚""", 8): + for line in chop_cells( + """่ฟ™ๆ˜ฏๅฏนไบšๆดฒ่ฏญ่จ€ๆ”ฏๆŒ็š„ๆต‹่ฏ•ใ€‚้ขๅฏนๆจกๆฃฑไธคๅฏ็š„ๆƒณๆณ•๏ผŒๆ‹’็ป็Œœๆต‹็š„่ฏฑๆƒ‘ใ€‚""", 8 + ): print(line) for n in range(80, 1, -1): - print(set_cell_size("""่ฟ™ๆ˜ฏๅฏนไบšๆดฒ่ฏญ่จ€ๆ”ฏๆŒ็š„ๆต‹่ฏ•ใ€‚้ขๅฏนๆจกๆฃฑไธคๅฏ็š„ๆƒณๆณ•๏ผŒๆ‹’็ป็Œœๆต‹็š„่ฏฑๆƒ‘ใ€‚""", n) + "|") + print( + set_cell_size( + """่ฟ™ๆ˜ฏๅฏนไบšๆดฒ่ฏญ่จ€ๆ”ฏๆŒ็š„ๆต‹่ฏ•ใ€‚้ขๅฏนๆจกๆฃฑไธคๅฏ็š„ๆƒณๆณ•๏ผŒๆ‹’็ป็Œœๆต‹็š„่ฏฑๆƒ‘ใ€‚""", n + ) + + "|" + ) print("x" * n) diff --git a/rich/color.py b/rich/color.py index f0fa026d64..971bc12190 100644 --- a/rich/color.py +++ b/rich/color.py @@ -553,7 +553,6 @@ def blend_rgb( if __name__ == "__main__": # pragma: no cover - from .console import Console from .table import Table from .text import Text diff --git a/rich/filesize.py b/rich/filesize.py index b3a0996b05..bcaea34572 100644 --- a/rich/filesize.py +++ b/rich/filesize.py @@ -30,7 +30,7 @@ def _to_str( return "{:,} bytes".format(size) for i, suffix in enumerate(suffixes, 2): # noqa: B007 - unit = base ** i + unit = base**i if size < unit: break return "{:,.{precision}f}{separator}{}".format( @@ -44,7 +44,7 @@ def _to_str( def pick_unit_and_suffix(size: int, suffixes: List[str], base: int) -> Tuple[int, str]: """Pick a suffix and base for the given size.""" for i, suffix in enumerate(suffixes): - unit = base ** i + unit = base**i if size < unit * base: break return unit, suffix diff --git a/rich/json.py b/rich/json.py index c51514f482..00ddd6862f 100644 --- a/rich/json.py +++ b/rich/json.py @@ -45,7 +45,6 @@ def __rich__(self) -> Text: if __name__ == "__main__": - import argparse import sys diff --git a/rich/layout.py b/rich/layout.py index e25ced675c..e46d475e93 100644 --- a/rich/layout.py +++ b/rich/layout.py @@ -228,7 +228,6 @@ def tree(self) -> "Tree": from rich.tree import Tree def summary(layout: "Layout") -> Table: - icon = layout.splitter.get_tree_icon() table = Table.grid(padding=(0, 1, 0, 0)) @@ -404,7 +403,7 @@ def __rich_console__( self._render_map = render_map layout_lines: List[List[Segment]] = [[] for _ in range(height)] _islice = islice - for (region, lines) in render_map.values(): + for region, lines in render_map.values(): _x, y, _layout_width, layout_height = region for row, line in zip( _islice(layout_lines, y, y + layout_height), lines diff --git a/rich/live.py b/rich/live.py index f2ba64a7eb..05a696112f 100644 --- a/rich/live.py +++ b/rich/live.py @@ -362,7 +362,7 @@ def process_renderables( table.add_column("Destination Currency") table.add_column("Exchange Rate") - for ((source, dest), exchange_rate) in exchange_rate_dict.items(): + for (source, dest), exchange_rate in exchange_rate_dict.items(): table.add_row( source, dest, diff --git a/rich/live_render.py b/rich/live_render.py index ca5ad23b2c..443ffa3694 100644 --- a/rich/live_render.py +++ b/rich/live_render.py @@ -61,7 +61,7 @@ def position_cursor(self) -> Control: (ControlType.ERASE_IN_LINE, 2), ) * (height - 1) - ) + ), ) return Control() @@ -75,14 +75,13 @@ def restore_cursor(self) -> Control: _, height = self._shape return Control( ControlType.CARRIAGE_RETURN, - *((ControlType.CURSOR_UP, 1), (ControlType.ERASE_IN_LINE, 2)) * height + *((ControlType.CURSOR_UP, 1), (ControlType.ERASE_IN_LINE, 2)) * height, ) return Control() def __rich_console__( self, console: Console, options: ConsoleOptions ) -> RenderResult: - renderable = self.renderable _Segment = Segment style = console.get_style(self.style) diff --git a/rich/markdown.py b/rich/markdown.py index 35ac28c1c2..1b9b10bbee 100644 --- a/rich/markdown.py +++ b/rich/markdown.py @@ -17,7 +17,6 @@ class MarkdownElement: - new_line: ClassVar[bool] = True @classmethod @@ -530,7 +529,6 @@ def __rich_console__( if __name__ == "__main__": # pragma: no cover - import argparse import sys diff --git a/rich/markup.py b/rich/markup.py index 473f86ae1a..c8f69b908d 100644 --- a/rich/markup.py +++ b/rich/markup.py @@ -224,7 +224,6 @@ def pop_style(style_name: str) -> Tuple[int, Tag]: if __name__ == "__main__": # pragma: no cover - MARKUP = [ "[red]Hello World[/red]", "[magenta]Hello [b]World[/b]", diff --git a/rich/pretty.py b/rich/pretty.py index 6d0295415a..f7b688dbd5 100644 --- a/rich/pretty.py +++ b/rich/pretty.py @@ -557,9 +557,9 @@ def iter_rich_args(rich_args: Any) -> Iterable[Union[Any, Tuple[str, Any]]]: last=root, ) - def iter_attrs() -> Iterable[ - Tuple[str, Any, Optional[Callable[[Any], str]]] - ]: + def iter_attrs() -> ( + Iterable[Tuple[str, Any, Optional[Callable[[Any], str]]]] + ): """Iterate over attr fields and values.""" for attr in attr_fields: if attr.repr: diff --git a/rich/progress.py b/rich/progress.py index 4eceea7352..0bab33a594 100644 --- a/rich/progress.py +++ b/rich/progress.py @@ -965,7 +965,6 @@ def remove_task(self, task_id: TaskID) -> None: if __name__ == "__main__": # pragma: no coverage - import random import time @@ -1021,7 +1020,6 @@ def remove_task(self, task_id: TaskID) -> None: console=console, transient=True, ) as progress: - task1 = progress.add_task("[red]Downloading", total=1000) task2 = progress.add_task("[green]Processing", total=1000) task3 = progress.add_task("[yellow]Thinking", total=1000, start=False) diff --git a/rich/progress_bar.py b/rich/progress_bar.py index 1797b5f786..5c47e6b375 100644 --- a/rich/progress_bar.py +++ b/rich/progress_bar.py @@ -154,7 +154,6 @@ def _render_pulse( def __rich_console__( self, console: Console, options: ConsoleOptions ) -> RenderResult: - width = min(self.width or options.max_width, options.max_width) ascii = options.legacy_windows or options.ascii_only if self.pulse: diff --git a/rich/prompt.py b/rich/prompt.py index daf76df855..c43b2f62c0 100644 --- a/rich/prompt.py +++ b/rich/prompt.py @@ -348,7 +348,6 @@ def process_response(self, value: str) -> bool: if __name__ == "__main__": # pragma: no cover - from rich import print if Confirm.ask("Run [i]prompt[/i] tests?", default=True): diff --git a/rich/segment.py b/rich/segment.py index 97ddc8d0aa..1cfd8cefca 100644 --- a/rich/segment.py +++ b/rich/segment.py @@ -94,7 +94,6 @@ def is_control(self) -> bool: @classmethod @lru_cache(1024 * 16) def _split_cells(cls, segment: "Segment", cut: int) -> Tuple["Segment", "Segment"]: # type: ignore - text, style, control = segment _Segment = Segment if cut >= segment.cell_length: @@ -586,7 +585,6 @@ def __rich_console__( if __name__ == "__main__": - if __name__ == "__main__": # pragma: no cover from rich.console import Console from rich.syntax import Syntax diff --git a/rich/status.py b/rich/status.py index 09eff405ec..65744838e3 100644 --- a/rich/status.py +++ b/rich/status.py @@ -107,7 +107,6 @@ def __exit__( if __name__ == "__main__": # pragma: no cover - from time import sleep from .console import Console diff --git a/rich/style.py b/rich/style.py index 0787c33147..a1f61c710a 100644 --- a/rich/style.py +++ b/rich/style.py @@ -428,10 +428,22 @@ def pick_first(cls, *values: Optional[StyleType]) -> StyleType: def __rich_repr__(self) -> Result: yield "color", self.color, None yield "bgcolor", self.bgcolor, None - yield "bold", self.bold, None, - yield "dim", self.dim, None, + yield ( + "bold", + self.bold, + None, + ) + yield ( + "dim", + self.dim, + None, + ) yield "italic", self.italic, None - yield "underline", self.underline, None, + yield ( + "underline", + self.underline, + None, + ) yield "blink", self.blink, None yield "blink2", self.blink2, None yield "reverse", self.reverse, None diff --git a/rich/syntax.py b/rich/syntax.py index 05d41c993e..b7a4122c30 100644 --- a/rich/syntax.py +++ b/rich/syntax.py @@ -483,7 +483,6 @@ def __rich_measure__( def __rich_console__( self, console: Console, options: ConsoleOptions ) -> RenderResult: - transparent_background = self._get_base_style().transparent_background code_width = ( ( @@ -612,7 +611,6 @@ def __rich_console__( if __name__ == "__main__": # pragma: no cover - import argparse import sys diff --git a/rich/table.py b/rich/table.py index b6a9c1ae6e..fdcd5a8c03 100644 --- a/rich/table.py +++ b/rich/table.py @@ -177,7 +177,6 @@ def __init__( caption_justify: "JustifyMethod" = "center", highlight: bool = False, ) -> None: - self.columns: List[Column] = [] self.rows: List[Row] = [] self.title = title @@ -427,7 +426,6 @@ def add_cell(column: Column, renderable: "RenderableType") -> None: def __rich_console__( self, console: "Console", options: "ConsoleOptions" ) -> "RenderResult": - if not self.columns: yield Segment("\n") return @@ -637,7 +635,7 @@ def get_padding(first_row: bool, last_row: bool) -> Tuple[int, int, int, int]: for first, last, (style, renderable) in loop_first_last(raw_cells): yield _Cell(style, _Padding(renderable, get_padding(first, last))) else: - for (style, renderable) in raw_cells: + for style, renderable in raw_cells: yield _Cell(style, renderable) def _get_padding_width(self, column_index: int) -> int: diff --git a/rich/traceback.py b/rich/traceback.py index 4f9012d732..a82b7e08bb 100644 --- a/rich/traceback.py +++ b/rich/traceback.py @@ -591,13 +591,14 @@ def render_locals(frame: Frame) -> Iterable[ConsoleRenderable]: if __name__ == "__main__": # pragma: no cover - from .console import Console console = Console() import sys - def bar(a: Any) -> None: # ่ฟ™ๆ˜ฏๅฏนไบšๆดฒ่ฏญ่จ€ๆ”ฏๆŒ็š„ๆต‹่ฏ•ใ€‚้ขๅฏนๆจกๆฃฑไธคๅฏ็š„ๆƒณๆณ•๏ผŒๆ‹’็ป็Œœๆต‹็š„่ฏฑๆƒ‘ + def bar( + a: Any + ) -> None: # ่ฟ™ๆ˜ฏๅฏนไบšๆดฒ่ฏญ่จ€ๆ”ฏๆŒ็š„ๆต‹่ฏ•ใ€‚้ขๅฏนๆจกๆฃฑไธคๅฏ็š„ๆƒณๆณ•๏ผŒๆ‹’็ป็Œœๆต‹็š„่ฏฑๆƒ‘ one = 1 print(one / a) @@ -615,7 +616,6 @@ def foo(a: Any) -> None: bar(a) def error() -> None: - try: try: foo(0) diff --git a/rich/tree.py b/rich/tree.py index 5fd46fd46b..27e257cbf7 100644 --- a/rich/tree.py +++ b/rich/tree.py @@ -70,7 +70,6 @@ def add( def __rich_console__( self, console: "Console", options: "ConsoleOptions" ) -> "RenderResult": - stack: List[Iterator[Tuple[bool, Tree]]] = [] pop = stack.pop push = stack.append @@ -187,7 +186,6 @@ def __rich_measure__( if __name__ == "__main__": # pragma: no cover - from rich.console import Group from rich.markdown import Markdown from rich.panel import Panel diff --git a/tests/test_align.py b/tests/test_align.py index 5f67dcbc77..9abf3e2d2c 100644 --- a/tests/test_align.py +++ b/tests/test_align.py @@ -8,7 +8,6 @@ def test_bad_align_legal(): - # Legal Align("foo", "left") Align("foo", "center") diff --git a/tests/test_color.py b/tests/test_color.py index 796f019838..010d797461 100644 --- a/tests/test_color.py +++ b/tests/test_color.py @@ -124,7 +124,6 @@ def test_get_ansi_codes() -> None: def test_downgrade() -> None: - assert Color.parse("color(9)").downgrade(0) == Color( "color(9)", ColorType.STANDARD, 9, None ) diff --git a/tests/test_inspect.py b/tests/test_inspect.py index 0ffc313acf..680adcb5a5 100644 --- a/tests/test_inspect.py +++ b/tests/test_inspect.py @@ -68,7 +68,6 @@ def test_render(): def test_inspect_text(): - expected = ( "โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ\n" "โ”‚ str(object='') -> str โ”‚\n" @@ -86,7 +85,6 @@ def test_inspect_text(): @skip_py36 @skip_py37 def test_inspect_empty_dict(): - expected = ( "โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ\n" "โ”‚ dict() -> new empty dictionary โ”‚\n" @@ -108,7 +106,6 @@ def test_inspect_empty_dict(): def test_inspect_builtin_function(): - expected = ( "โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ\n" "โ”‚ def print(...) โ”‚\n" @@ -125,7 +122,6 @@ def test_inspect_builtin_function(): @skip_py36 def test_inspect_integer(): - expected = ( "โ•ญโ”€โ”€โ”€โ”€โ”€โ”€ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ\n" "โ”‚ int([x]) -> integer โ”‚\n" @@ -142,7 +138,6 @@ def test_inspect_integer(): @skip_py36 def test_inspect_integer_with_value(): - expected = "โ•ญโ”€โ”€โ”€โ”€โ”€โ”€ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ\nโ”‚ int([x]) -> integer โ”‚\nโ”‚ int(x, base=10) -> integer โ”‚\nโ”‚ โ”‚\nโ”‚ โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ โ”‚\nโ”‚ โ”‚ 1 โ”‚ โ”‚\nโ”‚ โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ โ”‚\nโ”‚ โ”‚\nโ”‚ denominator = 1 โ”‚\nโ”‚ imag = 0 โ”‚\nโ”‚ numerator = 1 โ”‚\nโ”‚ real = 1 โ”‚\nโ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ\n" value = render(1, value=True) print(repr(value)) @@ -152,7 +147,6 @@ def test_inspect_integer_with_value(): @skip_py36 @skip_py37 def test_inspect_integer_with_methods(): - expected = ( "โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ\n" "โ”‚ int([x]) -> integer โ”‚\n" diff --git a/tests/test_live.py b/tests/test_live.py index 0c732f63ba..22243c35d8 100644 --- a/tests/test_live.py +++ b/tests/test_live.py @@ -23,7 +23,6 @@ def create_capture_console( def test_live_state() -> None: - with Live("") as live: assert live._started live.start() diff --git a/tests/test_markup.py b/tests/test_markup.py index 24b0c4417b..a0a2c43d23 100644 --- a/tests/test_markup.py +++ b/tests/test_markup.py @@ -158,7 +158,6 @@ def test_escape_escape(): def test_events(): - result = render("[@click]Hello[/@click] [@click='view.toggle', 'left']World[/]") assert str(result) == "Hello World" diff --git a/tests/test_progress.py b/tests/test_progress.py index 303c2e0871..95b77c52bb 100644 --- a/tests/test_progress.py +++ b/tests/test_progress.py @@ -111,7 +111,6 @@ def get_time(): def test_download_progress_uses_decimal_units() -> None: - column = DownloadColumn() test_task = Task(1, "test", 1000, 500, _get_time=lambda: 1.0) rendered_progress = str(column.render(test_task)) @@ -120,7 +119,6 @@ def test_download_progress_uses_decimal_units() -> None: def test_download_progress_uses_binary_units() -> None: - column = DownloadColumn(binary_units=True) test_task = Task(1, "test", 1024, 512, _get_time=lambda: 1.0) rendered_progress = str(column.render(test_task)) @@ -216,7 +214,6 @@ def test_render() -> None: def test_track() -> None: - console = Console( file=io.StringIO(), force_terminal=True, @@ -283,7 +280,6 @@ def test_progress_track() -> None: def test_columns() -> None: - console = Console( file=io.StringIO(), force_terminal=True, diff --git a/tests/test_repr.py b/tests/test_repr.py index c4f8bd09aa..b6adb4b9c6 100644 --- a/tests/test_repr.py +++ b/tests/test_repr.py @@ -14,7 +14,10 @@ def __init__(self, foo: str, bar: Optional[int] = None, egg: int = 1): def __rich_repr__(self): yield self.foo - yield None, self.foo, + yield ( + None, + self.foo, + ) yield "bar", self.bar, None yield "egg", self.egg @@ -47,7 +50,10 @@ def __init__(self, foo: str, *, bar: Optional[int] = None, egg: int = 1): class Bar(Foo): def __rich_repr__(self): yield (self.foo,) - yield None, self.foo, + yield ( + None, + self.foo, + ) yield "bar", self.bar, None yield "egg", self.egg diff --git a/tests/test_stack.py b/tests/test_stack.py index 5bbb885dbe..e961ddd8b2 100644 --- a/tests/test_stack.py +++ b/tests/test_stack.py @@ -2,7 +2,6 @@ def test_stack(): - stack = Stack() stack.push("foo") stack.push("bar") diff --git a/tests/test_status.py b/tests/test_status.py index 43ef94e01a..c2aec50480 100644 --- a/tests/test_status.py +++ b/tests/test_status.py @@ -6,7 +6,6 @@ def test_status(): - console = Console( color_system=None, width=80, legacy_windows=False, get_time=lambda: 0.0 ) diff --git a/tests/test_table.py b/tests/test_table.py index 29826e1182..0ffc57969d 100644 --- a/tests/test_table.py +++ b/tests/test_table.py @@ -114,7 +114,6 @@ def test_init_append_column(): def test_rich_measure(): - console = Console() assert Table("test_header", width=-1).__rich_measure__( console, console.options diff --git a/tests/test_text.py b/tests/test_text.py index 3727d1602c..e69f8523a5 100644 --- a/tests/test_text.py +++ b/tests/test_text.py @@ -665,7 +665,6 @@ def test_indentation_guides(): def test_slice(): - text = Text.from_markup("[red]foo [bold]bar[/red] baz[/bold]") assert text[0] == Text("f", spans=[Span(0, 1, "red")]) assert text[4] == Text("b", spans=[Span(0, 1, "red"), Span(0, 1, "bold")]) diff --git a/tests/test_traceback.py b/tests/test_traceback.py index 33ec880b41..917bd30292 100644 --- a/tests/test_traceback.py +++ b/tests/test_traceback.py @@ -213,7 +213,6 @@ def test_guess_lexer(): if __name__ == "__main__": # pragma: no cover - expected = render(get_exception()) with open("_exception_render.py", "wt") as fh: diff --git a/tools/make_terminal_widths.py b/tools/make_terminal_widths.py index 850f67a910..1e55683464 100644 --- a/tools/make_terminal_widths.py +++ b/tools/make_terminal_widths.py @@ -40,7 +40,6 @@ def make_widths_table() -> List[Tuple[int, int, int]]: def get_cell_size(table: List[Tuple[int, int, int]], character: str) -> int: - codepoint = ord(character) lower_bound = 0 upper_bound = len(table) - 1