Paul Ganssle <p.gans...@gmail.com> added the comment:

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 
================================

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue35327>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to