userver: testsuite.logcapture.Capture Class Reference
Loading...
Searching...
No Matches
testsuite.logcapture.Capture Class Reference

Detailed Description

Definition at line 86 of file logcapture.py.

Public Member Functions

 __init__ (self, CapturedLogs logs)
list[dict] select (self, **query)
 Select logs matching query.
 subscribe (self, **query)
 Subscribe to records matching query.

Protected Attributes

 _logs = logs

Constructor & Destructor Documentation

◆ __init__()

testsuite.logcapture.Capture.__init__ ( self,
CapturedLogs logs )

Definition at line 87 of file logcapture.py.

Member Function Documentation

◆ select()

list[dict] testsuite.logcapture.Capture.select ( self,
** query )

Select logs matching query.

Could only be used after capture contextmanager block.

.. code-block:: python

async with logcapture_server.capture() as capture: ... records = capture.select(text='Message to capture')

Definition at line 90 of file logcapture.py.

◆ subscribe()

testsuite.logcapture.Capture.subscribe ( self,
** query )

Subscribe to records matching query.

Returns decorator function. subscribe() may only be used within capture() block. Callqueue is returned.

.. code-block:: python

async with logcapture_server.capture() as capture: @capture.subscribe(text='Message to capture') def log_event(link, **other): ... ... assert log_event.wait_call()

Definition at line 119 of file logcapture.py.

Member Data Documentation

◆ _logs

testsuite.logcapture.Capture._logs = logs
protected

Definition at line 88 of file logcapture.py.


The documentation for this class was generated from the following file: