mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 23:24:27 +01:00
pytest: Configure logging in a fixture to match stdout capturing
pytest captures the output by monkey patching out `sys.stdout`. This may conflict with our use of `sys.stdout` when configuring logging, resulting in the "Write to closed file" issue that is spamming the logs. By making the logging configuration a fixture hopefully we always use the correct stdout (after pytest has monkey-patched it).
This commit is contained in:
committed by
Rusty Russell
parent
cf8c972883
commit
7201cb7315
@@ -17,7 +17,6 @@ import sqlite3
|
||||
import string
|
||||
import struct
|
||||
import subprocess
|
||||
import sys
|
||||
import threading
|
||||
import time
|
||||
|
||||
@@ -69,10 +68,6 @@ SLOW_MACHINE = env("SLOW_MACHINE", "0") == "1"
|
||||
TIMEOUT = int(env("TIMEOUT", 180 if SLOW_MACHINE else 60))
|
||||
|
||||
|
||||
if TEST_DEBUG:
|
||||
logging.basicConfig(level=logging.DEBUG, stream=sys.stdout)
|
||||
|
||||
|
||||
def wait_for(success, timeout=TIMEOUT):
|
||||
start_time = time.time()
|
||||
interval = 0.25
|
||||
|
||||
Reference in New Issue
Block a user