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

Method create_worker

tests/test_gtornado.py:139–153  ·  view source on GitHub ↗

Create a worker for testing.

(self)

Source from the content-addressed store, hash-verified

137 """Tests for signal handling in tornado worker."""
138
139 def create_worker(self):
140 """Create a worker for testing."""
141 cfg = Config()
142 cfg.set('workers', 1)
143
144 worker = gtornado.TornadoWorker(
145 age=1,
146 ppid=os.getpid(),
147 sockets=[],
148 app=mock.Mock(),
149 timeout=30,
150 cfg=cfg,
151 log=mock.Mock(),
152 )
153 return worker
154
155 def test_handle_exit_sets_alive_false(self):
156 """Test that handle_exit sets alive=False through parent."""

Calls 2

setMethod · 0.95
ConfigClass · 0.90

Tested by

no test coverage detected