|
1 | 1 | """Tests for aiohttp/worker.py""" |
2 | 2 | import asyncio |
| 3 | +import os |
3 | 4 | import pathlib |
4 | 5 | import socket |
5 | 6 | import ssl |
@@ -217,8 +218,9 @@ def test__run_ok(worker, loop): |
217 | 218 | yield from worker._run() |
218 | 219 |
|
219 | 220 | worker.notify.assert_called_with() |
220 | | - worker.log.info.assert_called_with("Parent changed, shutting down: %s", |
221 | | - worker) |
| 221 | + if os.getppid() != 1: # not Docker |
| 222 | + worker.log.info.assert_called_with("Parent changed, shutting down: %s", |
| 223 | + worker) |
222 | 224 |
|
223 | 225 | args, kwargs = loop.create_server.call_args |
224 | 226 | assert 'ssl' in kwargs |
@@ -257,8 +259,9 @@ def test__run_ok_unix_socket(worker, loop): |
257 | 259 | yield from worker._run() |
258 | 260 |
|
259 | 261 | worker.notify.assert_called_with() |
260 | | - worker.log.info.assert_called_with("Parent changed, shutting down: %s", |
261 | | - worker) |
| 262 | + if os.getppid() != 1: # not Docker |
| 263 | + worker.log.info.assert_called_with("Parent changed, shutting down: %s", |
| 264 | + worker) |
262 | 265 |
|
263 | 266 | args, kwargs = loop.create_unix_server.call_args |
264 | 267 | assert 'ssl' in kwargs |
@@ -374,8 +377,9 @@ def test__run_ok_no_max_requests(worker, loop): |
374 | 377 | yield from worker._run() |
375 | 378 |
|
376 | 379 | worker.notify.assert_called_with() |
377 | | - worker.log.info.assert_called_with("Parent changed, shutting down: %s", |
378 | | - worker) |
| 380 | + if os.getppid() != 1: # not Docker |
| 381 | + worker.log.info.assert_called_with("Parent changed, shutting down: %s", |
| 382 | + worker) |
379 | 383 |
|
380 | 384 | args, kwargs = loop.create_server.call_args |
381 | 385 | assert 'ssl' in kwargs |
|
0 commit comments