Skip to content

pytest.raises should complain about unknown arguments #3348

@nicoddemus

Description

@nicoddemus

The example below passes without any complaints:

import pytest
def test():
    with pytest.raises(ValueError, unknown='foo'):
        raise ValueError

It should raise a TypeError because of the unknown parameter.

Follow up of #258

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueeasy issue that is friendly to new contributortype: bugproblem that needs to be addressed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions