ScreenPyHQ / screenpy

Screenplay pattern base for Python automated UI test suites.
MIT License
27 stars 3 forks source link

IsNot logging is convoluted #139

Open bandophahita opened 5 months ago

bandophahita commented 5 months ago

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 commented 5 months ago

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 commented 5 months ago

Yes, i agree!