Skip to content

py.test can't xfail tests parametrized with callable objects #750

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
pytestbot opened this issue May 23, 2015 · 2 comments
Closed

py.test can't xfail tests parametrized with callable objects #750

pytestbot opened this issue May 23, 2015 · 2 comments
Assignees
Labels
topic: parametrize related to @pytest.mark.parametrize type: bug problem that needs to be addressed
Milestone

Comments

@pytestbot
Copy link
Contributor

Originally reported by: sergey chipiga (BitBucket: schipiga, GitHub: schipiga)


Code example:

import pytest


class A(object): pass

@pytest.mark.parametrize('x', [pytest.mark.xfail(A)])
def test(x):
    assert False

or

import pytest

def b():pass

@pytest.mark.parametrize('x', [pytest.mark.xfail(b)])
def test(x):
    assert False

The result: proba.py::test[x0] FAILED


@pytestbot
Copy link
Contributor Author

Original comment by holger krekel (BitBucket: hpk42, GitHub: hpk42):


Hum, not sure how easy it is to allow it cc @pfctdayelise

You could also check yourself in _pytest/python.py's parametrize functions.

@pytestbot pytestbot added the type: bug problem that needs to be addressed label Jun 15, 2015
@pfctdayelise pfctdayelise self-assigned this Jul 10, 2015
@pfctdayelise pfctdayelise added the topic: parametrize related to @pytest.mark.parametrize label Jul 25, 2015
@RonnyPfannschmidt RonnyPfannschmidt modified the milestones: 2.8, 2.8.dev Sep 13, 2015
@RonnyPfannschmidt RonnyPfannschmidt modified the milestones: 2.8.2, 2.8.1 Sep 27, 2015
@RonnyPfannschmidt RonnyPfannschmidt modified the milestones: 2.8.2, 2.8.3 Oct 10, 2015
@nicoddemus nicoddemus modified the milestones: 2.8.3, 2.8.4 Nov 23, 2015
@RonnyPfannschmidt RonnyPfannschmidt modified the milestones: 2.8.4, 2.8.5 Dec 6, 2015
@RonnyPfannschmidt RonnyPfannschmidt modified the milestones: 2.8.5, 2.8.6 Dec 14, 2015
@RonnyPfannschmidt RonnyPfannschmidt modified the milestones: 3.1.0, 2.8.6 Jul 19, 2016
@RonnyPfannschmidt
Copy link
Member

closing as wontfix - the parametrize hack will gi via #1921

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: parametrize related to @pytest.mark.parametrize type: bug problem that needs to be addressed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants