Skip to content
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

Truncate locals with large/long runtime values in failure message #75

Open
thejunglejane opened this issue Jun 7, 2018 · 2 comments
Open
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@thejunglejane
Copy link
Contributor

thejunglejane commented Jun 7, 2018

Is your feature request related to a problem? Please describe.
Currently, marbles doesn't do anything with local variables before putting them in the failure message beyond casting them to strings. When local variables have really long string representations, they can overwhelm the failure message, which is unpleasant to look at but also hinders the failure message's readability.

Describe the solution you'd like
I would like marbles to truncate long local variables, probably using the same length settings as unittest.util.

unittest.util has some repr-truncating functionality that we could use, and/or we could also use reprlib.

Describe alternatives you've considered
A workaround for this is to have the test author make locals with long runtime values internal so they don't show up in the failure message at all. If they want the test consumer to be able to see those local variables, the test author can create their own public local that is the truncated representation.

@thejunglejane thejunglejane added enhancement New feature or request good first issue Good for newcomers labels Jun 7, 2018
@leifwalsh
Copy link
Contributor

leifwalsh commented Sep 25, 2018

Somewhat related: #96

@joshhn
Copy link
Contributor

joshhn commented Dec 22, 2023

Hi @leifwalsh, I noticed there is a PR resolving this issue but it's still open, so I just want to confirm if this issue is completed or still open to take.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants