[publiqa_2] How to mask data in logging output

Sometimes it is necessary not to display certain test data in plain text in the log output. To achieve this, the Sensitive type can be applied to the relevant step parameters, as shown in the example below.


from publiqa import step
from publiqa.types import Sensitive

@step
def step_1(password: Sensitive[str]):
    """Just an example"""
    # Write your step code here

Please note that the use of the Sensitive type does NOT suppress the explicitly requested writing out of data, e.g. via logger.info(password)!

The Sensitive type instead ensures that sensitive test data is not displayed as part of the provided test data in plain text:

TestStep   my_module.step_1     Start Step
TestStep   my_module.step_1     Provided step data:
TestStep   my_module.step_1     data_set=default
TestStep   my_module.step_1     password='******'
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us