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

An Action/Task's beat gravitas does not apply to inner beats #55

Open
perrygoy opened this issue Mar 1, 2023 · 1 comment
Open

An Action/Task's beat gravitas does not apply to inner beats #55

perrygoy opened this issue Mar 1, 2023 · 1 comment

Comments

@perrygoy
Copy link
Member

perrygoy commented Mar 1, 2023

Consider this simple Task:

class ExampleClick:
    ...
    @beat("{} clicks on something for an example.", gravitas=AIRY)
    def perform_as(self, the_actor: Actor) -> None:
        """Direct the Actor to do a click for an example in a Github issue."""
        the_actor.attempts_to(Click.on_the(self.example_target))

The beat on this Task has an AIRY gravitas, which any user would expect would apply to all the Performables performed within the task as well. But it does not. The Click contained within it will not have the gravitas of its parent, which will cause the default behavior to be taken (a logging.info message to be emitted, in the case of StdOutAdapter).

It would be very nice if the outer-most beat wrapping would "set" the gravitas for all of its inner beats and asides as well!

@bandophahita
Copy link
Contributor

We might consider implementing an object that you can wrap actions to accomplish this:

actor(Gravitas.airy(ExampleClick(TARGET)))

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