Thanks to visit codestin.com
Credit goes to github.com

Skip to content

@allure.step decorator fails if one of the method parameters has a default value #440

@tanistra

Description

@tanistra

I have a method that has the default argument set to "None". (it can be string as well)

@allure.step(
    "Send message: '{message}' on {channel} with props: '{props}'")
def send_message(
        self,
        channel: str,
        message: str,
        username: str = None,
        props: Dict = None) -> None:
    ...

Calling this method without the props parameter:

self.bot.send_message(
       channel=self.DZIUNIA['mm_channel_id'],
       message=letter)

causes a Python exception:

E KeyError: 'props'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions