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

See should have option to bypass get_additive_description #66

Open
bandophahita opened this issue Mar 22, 2023 · 4 comments
Open

See should have option to bypass get_additive_description #66

bandophahita opened this issue Mar 22, 2023 · 4 comments
Labels
enhancement New feature or request

Comments

@bandophahita
Copy link
Contributor

bandophahita commented Mar 22, 2023

There are a few times where using the output from get_additive_description doesn't fit.
It would be good if See had an option to bypass using get_additive_description when logging

marcel.will(See(SimpleQuestion(), IsEqual(True)).without_additive_description())
# or maybe 
marcel.will(See.without_additive_description(SimpleQuestion(), IsEqual(True)))

the method name should be something far sexier than the above

@perrygoy
Copy link
Member

perrygoy commented Mar 22, 2023

After a quick discussion on Discord, it seems that adding a .describe() method to return what you actually want to log seems to fix the issue. However!

get_additive_description lower-cases the first letter of the string returned by .describe(). Sometimes you might want a capital. How do we handle this?

class SimpleQuestion:
    ...
    def describe() -> str:
        return "SimpleQuestion"
Marcel sees if simpleQuestion is equal to True.
    Marcel examines SimpleQuestion
        => False
    ... hoping it's equal to False.
        => <True>

@bandophahita
Copy link
Contributor Author

The short answer is See needs to be told how to use the describe() from the question rather than utilize get_additive_description:

actor.will(See(question, resolution).using_describe())

or maybe there could be some way for get_additive_description to know to skip it's extra processing by setting something on the question?

actor.will(See(question.skipping_additive(), resolution))

@perrygoy
Copy link
Member

perrygoy commented Apr 7, 2023

I feel like that's giving too much to the Questions or to See to know how to do; i don't like the bond that creates between them and get_additive_description.

The answer's gotta be within get_additive_description somehow... maybe we ask ChatGPT to make our additive string for us. :P

@bandophahita
Copy link
Contributor Author

Could get_additive_description determine if the describe was overridden?

@bandophahita bandophahita added the enhancement New feature or request label Sep 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants