(self)
| 12 | |
| 13 | class test_worker: |
| 14 | def setup_method(self): |
| 15 | self.app = Celery('celerytest', backend='cache+memory://', broker='memory://', ) |
| 16 | |
| 17 | @self.app.task |
| 18 | def add(x, y): |
| 19 | return x + y |
| 20 | |
| 21 | self.add = add |
| 22 | |
| 23 | @self.app.task |
| 24 | def error_task(): |
| 25 | raise NotImplementedError() |
| 26 | |
| 27 | self.error_task = error_task |
| 28 | |
| 29 | self.app.config_from_object({ |
| 30 | 'worker_hijack_root_logger': False, |
| 31 | }) |
| 32 | |
| 33 | # to avoid changing the root logger level to ERROR, |
| 34 | # we have to set both app.log.loglevel start_worker arg to 0 |
| 35 | # (see celery.app.log.setup_logging_subsystem) |
| 36 | self.app.log.loglevel = 0 |
| 37 | |
| 38 | def test_start_worker(self): |
| 39 | with start_worker(app=self.app, loglevel=0): |
nothing calls this directly
no test coverage detected