Skip to content

Feature: support proper repr and str for Canvas - #740

Merged
penguinolog merged 1 commit into
urwid:masterfrom
penguinolog:feature_canvas_repr
Jan 12, 2024
Merged

penguinolog merged 1 commit into
urwid:masterfrom
penguinolog:feature_canvas_repr

Conversation

@penguinolog

Copy link
Copy Markdown
Collaborator

Better error messages and simpler debugging
Ignoring all exceptions in methods as it can cause infinite loop in error handlers

Checklist
  • I've ensured that similar functionality has not already been implemented
  • I've ensured that similar functionality has not earlier been proposed and declined
  • I've branched off the master or python-dual-support branch
  • I've merged fresh upstream into my branch recently
  • I've ran tox successfully in local environment
  • I've included docstrings and/or documentation and/or examples for my code (if this is a new feature)

@penguinolog penguinolog added the Feature Feature request/implementation label Jan 12, 2024
@penguinolog
penguinolog requested review from ulidtko and wardi January 12, 2024 08:43
@github-actions github-actions Bot added the Tests Tests label Jan 12, 2024
@coveralls

coveralls commented Jan 12, 2024 •

Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 7500785068

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.03%) to 69.814%

Totals Coverage Status
Change from base Build 7492945541: 0.03%
Covered Lines: 8257
Relevant Lines: 11915

💛 - Coveralls

Better error messages and simpler debugging
Comment thread tests/test_canvas.py

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

applied auto-fotmatting

Comment thread tests/test_canvas.py


class CanvasTest(unittest.TestCase):
def test_basic_info(self):

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 new tests for repr and str

Comment thread tests/test_canvas.py
def cct(self, widget, size, focus, expected):
got = urwid.CanvasCache.fetch(widget, urwid.Widget, size, focus)
assert expected==got, f"got: {got} expected: {expected}"
with self.subTest(widget=widget, size=size, focus=focus, expected=expected):

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use subTest to allow failing on multiple scenarios on CI

@penguinolog
penguinolog merged commit ee5332d into urwid:master Jan 12, 2024
@penguinolog
penguinolog deleted the feature_canvas_repr branch January 12, 2024 11:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature Feature request/implementation Tests Tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants