fix bug: mod_watch restart service in test mode

also pep8 fix