Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Option of treating XPASS as failure? #1355
// enhancement idea
tldr; I want my xfail'ed tests to cause test suite to fail if they succeed
Often I find myself tests that given an two set outputs, sometimes return a value and sometimes raise specific exceptions. I'm currently splitting this in two separate tests, one for "good" values, one for exceptions, and use
Inspired by docs on parametrizing tests I thought I could use mark.xfail to group these tests in one logical thing.
Ideally, it would work as an extra argument to xfail (strict=True?), rather than command line option, because I cannot set the value globally.
Basically, I'd like this to fail:
Does this already exist somewhere?
edit: I dunno how to mark this as proposal per contributing guidelines
Ah, cool, I'm not insane then :)
PR - I'll try to take a look next week, but no promises, I suspect this might be beyond me :)
// what would be really cool would be an option to pass a fixture into
I'll close this one, #1299 is good enough.
@rabbbit thanks for the clarification.
How about this then:
Once this is released, you should add
Does that cover your needs?