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

Method create_worker

tests/test_gtornado.py:347–362  ·  tests/test_gtornado.py::TestRunMethod.create_worker

Create a worker for testing.

(self)

Source from the content-addressed store, hash-verified

345 class="st">""class="st">"Tests for the run method."class="st">""
346
347 def create_worker(self):
348 class="st">""class="st">"Create a worker for testing."class="st">""
349 cfg = Config()
350 cfg.set(&class="cm">#x27;workers', 1)
351 cfg.set(&class="cm">#x27;keepalive', 2)
352
353 worker = gtornado.TornadoWorker(
354 age=1,
355 ppid=os.getpid(),
356 sockets=[],
357 app=mock.Mock(),
358 timeout=30,
359 cfg=cfg,
360 log=mock.Mock(),
361 )
362 return worker
363
364 def test_run_sets_up_callbacks(self):
365 class="st">""class="st">"Test that run sets up periodic callbacks."class="st">""

Calls 2

setMethod · 0.95
ConfigClass · 0.90

Tested by

no test coverage detected