We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
What's the proper way to indicate that a test will fail (e.g., pytest's "xfail") with parameterized.expand?
parameterized.expand
I've tried using pytest.mark with parameterized.expand:
pytest.mark
import unittest import pytest from parameterized import parameterized class ModelRegressionTestCase(unittest.TestCase): def setUp(self): self.model = load_model() @parameterized.expand( [ ("Word", "Word"), pytest.param("Word Second", "Word second", marks=pytest.mark.xfail(reason="The reason it fails")), ] ) def test_sanity(self, x, y): expectation = {"answer": y, "score": 1} result = self.model.predict(x) self.assertEqual(expectation, result)
But perhaps those are incompatible. I get a TypeError:
=================================== FAILURES =================================== ____________________ ModelRegressionTestCase.test_sanity_2 _____________________ a = (<test.test_model.ModelRegressionTestCase testMethod=test_sanity_2>,) @wraps(func) def standalone_func(*a): > return func(*(a + p.args), **p.kwargs) E TypeError: test_sanity() takes 3 positional arguments but 4 were given ../.local/lib/python3.6/site-packages/parameterized/parameterized.py:533: TypeError
Does parameterized support something like xfail specifically in the context of the expand decorator?
parameterized
expand
The text was updated successfully, but these errors were encountered:
I think there's currently no way to expect an exception as beautifully as pytest.mark.xfail would allow to do.
pytest.mark.xfail
Also, you are using pytest.param in your example, but parameterized has its own param class - it doesn't use pytest's one.
pytest.param
param
I would be very happy to see a xfail implementation in parameterized :-)
xfail
Sorry, something went wrong.
Bumping this! xfail in parameterized would be a very helpful addition!
No branches or pull requests
What's the proper way to indicate that a test will fail (e.g., pytest's "xfail") with
parameterized.expand
?I've tried using
pytest.mark
withparameterized.expand
:But perhaps those are incompatible. I get a TypeError:
Does
parameterized
support something like xfail specifically in the context of theexpand
decorator?The text was updated successfully, but these errors were encountered: