| 136 | """ |
| 137 | |
| 138 | def setup_method(self): |
| 139 | state.should_stop = None |
| 140 | state.should_terminate = None |
| 141 | # Avoid touching real OS signal state: celery.platforms.signals |
| 142 | # normally calls signal.signal() on assignment, which we don't want |
| 143 | # running inside a test process. _shutdown_handler only needs |
| 144 | # somewhere to stash the closure it builds. |
| 145 | self._signals_patch = patch('celery.apps.worker.platforms.signals', {}) |
| 146 | self.fake_signals = self._signals_patch.start() |
| 147 | |
| 148 | def teardown_method(self): |
| 149 | self._signals_patch.stop() |