Created
February 27, 2019 10:55
-
-
Save anapaulagomes/4b3b8ba4ca0c10a625b7482f6164ee8f to your computer and use it in GitHub Desktop.
pytest-grilo: your consciousness remembering you to take care of yourself
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
def choose_action(): | |
actions = [ | |
"It's time to drink water!", | |
"Have you stretched on the last hour?", | |
"You should walk around a bit", | |
] | |
return random.choice(actions) | |
def pytest_report_collectionfinish(config, startdir, items): | |
# it will be executed after tests collection and before tests execution | |
markup = {'yellow': True} | |
action_message = f'\n{choose_action()}\n' | |
terminal_writer = config.get_terminal_writer() | |
terminal_writer.write(action_message, **markup) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment