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

IsNot logging is convoluted #139

Open
bandophahita opened this issue Apr 4, 2024 · 2 comments
Open

IsNot logging is convoluted #139

bandophahita opened this issue Apr 4, 2024 · 2 comments

Comments

@bandophahita
Copy link
Contributor

bandophahita commented Apr 4, 2024

Consider the following code:

IsNot(EqualTo(True)).resolve()

Which produces the following log

... hoping it's not equal to <True>.
    ... hoping it's equal to <True>.
        => <True>
    => not <True>

Sure would be nice if it logged the following:

... hoping it's not equal to <True>.
    => not <True>

My question is, should this be done by the library by default?

@bandophahita
Copy link
Contributor Author

If we think it's OK to do this, it is a simple change to IsNot

    def resolve(self) -> Matcher[object]:
        """Produce the Matcher to make the assertion."""
        return is_not(Silently(self.resolution).resolve())

@perrygoy
Copy link
Member

perrygoy commented Apr 4, 2024

Yes, i agree!

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

No branches or pull requests

2 participants