Message330528
As "prior art" the way that pytest does this is to have parametrized tests show up as separate tests:
import pytest
@pytest.mark.parametrize("i", range(1, 3))
def test_something(i):
if i > 1:
pytest.skip('Not supported')
assert i == 1
@pytest.mark.parametrize("i", range(1, 3))
def test_something_else(i):
assert 3 > i >= 1
Running `pytest -v` for this gives:
======================================= test session starts ========================================
platform linux -- Python 3.7.1, pytest-4.0.1, py-1.7.0, pluggy-0.8.0
cachedir: .pytest_cache
rootdir: /tmp/test_mod, inifile:
collected 4 items
test_mod.py::test_something[1] PASSED [ 25%]
test_mod.py::test_something[2] SKIPPED [ 50%]
test_mod.py::test_something_else[1] PASSED [ 75%]
test_mod.py::test_something_else[2] PASSED [100%]
=============================== 3 passed, 1 skipped in 0.01 seconds ================================ |
|
Date |
User |
Action |
Args |
2018-11-27 15:29:45 | p-ganssle | set | recipients:
+ p-ganssle, rbcollins, ezio.melotti, michael.foord |
2018-11-27 15:29:45 | p-ganssle | set | messageid: <1543332585.01.0.788709270274.issue35327@psf.upfronthosting.co.za> |
2018-11-27 15:29:45 | p-ganssle | link | issue35327 messages |
2018-11-27 15:29:44 | p-ganssle | create | |
|