Skip to content

Commit 9bcb7aa

Browse files
committed
autobahn client runner: disable debug during metadata operations
1 parent 68cf102 commit 9bcb7aa

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

autobahn/client.py

+5-7
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,12 @@ async def update_reports(url):
5151

5252

5353
async def run_tests(args):
54+
logger = logging.getLogger('trio-websocket')
5455
if args.debug_cases:
5556
# Don't fetch case count when debugging a subset of test cases. It adds
5657
# noise to the debug logging.
5758
case_count = None
5859
test_cases = args.debug_cases
59-
# Automatically enable debug logging when running individual test cases.
60-
logging.getLogger('trio-websocket').setLevel(logging.DEBUG)
6160
else:
6261
case_count = await get_case_count(args.url)
6362
test_cases = list(range(1, case_count + 1))
@@ -68,20 +67,19 @@ async def run_tests(args):
6867
logger.info("Running test case %s (%d of %d)", case_id, case, case_count)
6968
else:
7069
logger.info("Debugging test case %s (%d)", case_id, case)
70+
logger.setLevel(logging.DEBUG)
7171
try:
7272
await run_case(args.url, case)
7373
except Exception: # pylint: disable=broad-exception-caught
7474
logger.exception(' runtime exception during test case %s (%d)', case_id, case)
7575
exception_cases.append(case_id)
76+
logger.setLevel(logging.INFO)
77+
logger.info('Updating report')
78+
await update_reports(args.url)
7679
if exception_cases:
7780
logger.error('Runtime exception in %d of %d test cases: %s',
7881
len(exception_cases), len(test_cases), exception_cases)
7982
sys.exit(1)
80-
if not args.debug_cases:
81-
# Don't update report when debugging a single test case. It adds noise
82-
# to the debug logging.
83-
logger.info('Updating report')
84-
await update_reports(args.url)
8583

8684

8785
def parse_args():

0 commit comments

Comments
 (0)