Can Pytest run at a pre-scheduled time?

2019-07-10 16:55发布

I am using pytest to run my tests using python3 script like below:

pytest -s test_file.py | tee -a myoutput.log

It works. Now I would like to run this at a specific time everyday, I tried "crontab -e" from linux console but failed. I mean there is no log added to "myoutput.log" file. Can anyone please help? thanks!

42 00 * * * /usr/bin/pytest pytest -s /data/smc/test_file.py | tee -a myoutput.log

1条回答
Lonely孤独者°
2楼-- · 2019-07-10 17:29

I think it can be done by using cron output. eg:

42 00 * * * /usr/bin/pytest pytest -s /data/smc/test_file.py >> /Your-log-path.log 2>&1

查看更多
登录 后发表回答