You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been using the code for parametrize_cases and have made a couple of extensions that you may want to adopt into the main source code. Sometimes you may want to mark your test cases individually with pytest.mark.skip or pytest.mark.xfail for example. This issue will implement the handling of marks on a case by case basis.
The first one I made was to add a marks parameter (marks: Optional[MarkDecorator] = None) to the Case class, and then wrapping each case tuple in the pytest.param function, passing in the marks.
# If marks are given, wrap the case tuple.ifcase.marks:
case_tuple=pytest.param(*case_tuple, marks=case.marks)
This required a couple of other small refactors to express the intention of the code better. Happy to take this issue forward on a Pull Request but I may need some help understanding how to test pytest functionality when all I know is testing within pytest. I can see you have nox setup, can you provide any guidance there?
Test cases:
That an individual test is skipped, when marked with pytest.mark.skip
That an individual test reports as xfail when marked with pytest.mark.xfail
The text was updated successfully, but these errors were encountered:
I'm not opposed to having the ability to specify marks. However, won't this approach cause problems when mixed with the optional positional string argument? Currently the signature for Case.__init__ is
I've been using the code for
parametrize_cases
and have made a couple of extensions that you may want to adopt into the main source code. Sometimes you may want to mark your test cases individually withpytest.mark.skip
orpytest.mark.xfail
for example. This issue will implement the handling of marks on a case by case basis.The first one I made was to add a marks parameter (
marks: Optional[MarkDecorator] = None
) to theCase
class, and then wrapping each case tuple in thepytest.param
function, passing in the marks.This required a couple of other small refactors to express the intention of the code better. Happy to take this issue forward on a Pull Request but I may need some help understanding how to test
pytest
functionality when all I know is testing withinpytest
. I can see you havenox
setup, can you provide any guidance there?Test cases:
pytest.mark.skip
pytest.mark.xfail
The text was updated successfully, but these errors were encountered: