ScreenPyHQ / screenpy

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

allow beat to dictate when to log None #113

Open bandophahita opened 10 months ago

bandophahita commented 10 months ago

beat should have an argument that tells it when to log the return values if they are None.

bandophahita commented 9 months ago

To add a little more context;

beat wraps the function which might return something but it's very difficult to know exactly when we should log None was returned.

105 was added to help with determining, but it depends on the user annotating the function returns anything besides None. (e.g. def foo() -> str | None:)

While the above should suffice in most cases, there could be times where users still wants to log the fact that None returned and either they do not annotate or the annotation specifically designates the return is always None (e.g. def foo() -> None:).

In those rare cases it would be good if they had the ability to tell beat to log None was returned anyway.