Положите сон в tearDown
метод вашего TestCase
import time
class ExampleTestCase(unittest.TestCase):
def tearDown(self):
time.sleep(1) # sleep time in seconds
tearDown()
будет выполняться после каждого теста в этом TestCase
классе.
Документацию по модулям можно найти здесь .