add setup and teardown block, in these blocks, we can exec functions such as sleep

This commit is contained in:
debugtalk
2017-09-04 22:58:40 +08:00
parent 154e050a60
commit cd6e742808
5 changed files with 36 additions and 4 deletions

View File

@@ -28,3 +28,8 @@ def get_current_date(fmt="%Y-%m-%d"):
""" get current date, default format is %Y-%m-%d
"""
return datetime.datetime.now().strftime(fmt)
def sleep(sec):
""" sleep specified seconds
"""
time.sleep(sec)