Skip to content

Custom message on Live overflow #3702

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

samuelcolvin
Copy link

@samuelcolvin samuelcolvin commented Apr 16, 2025

Type of changes

  • Bug fix
  • New feature
  • Documentation / docstrings
  • Tests
  • Other

Checklist

  • I've run the latest black with default args on new code.
  • I've updated CHANGELOG.md and CONTRIBUTORS.md where appropriate.
  • I've added tests for new code.
  • I accept that @willmcgugan may be pedantic in the code review.

Description

Allow a custom message with a Live overflows, instead of an ellipsis.

@samuelcolvin samuelcolvin changed the title Ellipsis message Custom message on Live overflow Apr 16, 2025
@samuelcolvin
Copy link
Author

Bump @willmcgugan, could we at least run tests.

(Curious why you don't allow tests to run for all PRs?)

@willmcgugan
Copy link
Collaborator

(Curious why you don't allow tests to run for all PRs?)

That used to be the case. Github changed it, and I haven't changed it back.

@codecov-commenter
Copy link

codecov-commenter commented Apr 20, 2025

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.98%. Comparing base (225cb07) to head (01bc82a).
Report is 30 commits behind head on master.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3702      +/-   ##
==========================================
- Coverage   98.24%   97.98%   -0.27%     
==========================================
  Files          74       74              
  Lines        8105     8147      +42     
==========================================
+ Hits         7963     7983      +20     
- Misses        142      164      +22     
Flag Coverage Δ
unittests 97.98% <100.00%> (-0.27%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Collaborator

@willmcgugan willmcgugan left a comment

Choose a reason for hiding this comment

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

I am reluctant to add new parameters, as constructor signatures can get excessively large.

Since this parameter doesn't seem essential, how about an alternative way of configuring it? Perhaps a get_vertical_overflow_message method, so it could be customized in a subclass.

@@ -59,7 +71,9 @@ def __init__(
transient: bool = False,
redirect_stdout: bool = True,
redirect_stderr: bool = True,
vertical_overflow: VerticalOverflowMethod = "ellipsis",
vertical_overflow: Union[
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not keen on overloading a parameter like this. If it becomes a general purpose extension mechanism, it could quickly become unwieldy. I'd prefer to keep the message a separate value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants