def __init__(self, code_path, round_time=None, mute=False, test_runner=None):
self.code_path = code_path
self.round_time = round_time or self.ROUND_TIME
self.sound_player = mock.Mock() if mute else SoundHandler()
test_runner = test_runner or DoctestTestRunner(code_path=code_path,
sound_player=self.sound_player)
event_handler = DojoCodeHandler(dojo=self, test_runner=test_runner)
self.observer = Observer()
self.observer.schedule(event_handler, self.code_path, recursive=False)
self.timer = Timer(self.round_time)
评论列表
文章目录