Skip to content

Make knownfailure work even without parentheses #731

@mnmelo

Description

@mnmelo

This is a very minor enhancement. I'm writing it down so as not to forget.
I came across a way of not needing parentheses in the test decorator (implemented in the flaky nose plugin).

This would be nice to have, as it would simplify the default knownfailure decorator syntax.

As it stands right now we always need to write down the parentheses (@knownfailure()) even if we're passing no arguments to the decorator.

Rich e:

This is referring to the knownfailure decorator in our testsuite.

Ideally this should work like so:

# can use default kwargs without having the brackets
@knownfailure
def test_this():
    assert_(1 == 2)

# but the same decorator works with brackets to specify parameters
@knownfailure(exc_type=ValueError)
def test_that():
    some_function()  # which will raise ValueError currently, as a known problem

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions