@pytest.yield_fixture(params=[None, tdata])
def temp_server_with_excfmt(request):
 data = request.param
 log_format_exc = (lambda tb: 'CUSTOM TRACEBACK')
 stream = StringIO()
 s = Server(copy(data), formats=all_formats, allow_add=True, logfile=stream, log_exception_formatter=log_format_exc)
 s.app.testing = True
 with s.app.test_client() as client:
  (yield (client, stream))

@ pytest . yield_fixture ( params = [ None , tdata ] ) def temp_server_with_excfmt ( request ) : data = request . param log_format_exc = ( lambda tb : 'CUSTOM TRACEBACK' ) stream = StringIO ( ) s = Server ( copy ( data ) , formats = all_formats , allow_add = True , logfile = stream , log_exception_formatter = log_format_exc ) s . app . testing = True with s . app . test_client ( ) as client : ( yield ( client , stream ) )
with a custom log exception formatter .