MCPcopy
hub / github.com/benoitc/gunicorn / create_worker

Method create_worker

tests/test_gtornado.py:184–198  ·  view source on GitHub ↗

Create a worker for testing.

(self)

Source from the content-addressed store, hash-verified

182 """Tests for watchdog functionality."""
183
184 def create_worker(self):
185 """Create a worker for testing."""
186 cfg = Config()
187 cfg.set('workers', 1)
188
189 worker = gtornado.TornadoWorker(
190 age=1,
191 ppid=os.getpid(),
192 sockets=[],
193 app=mock.Mock(),
194 timeout=30,
195 cfg=cfg,
196 log=mock.Mock(),
197 )
198 return worker
199
200 def test_watchdog_notifies_when_alive(self):
201 """Test that watchdog calls notify when alive."""

Calls 2

setMethod · 0.95
ConfigClass · 0.90

Tested by

no test coverage detected