Update test for error in 'indirect' parameter
This commit is contained in:
parent
63bac67fb5
commit
db9809d6dc
|
@ -261,24 +261,11 @@ class TestMetafunc:
|
||||||
"*1 passed*",
|
"*1 passed*",
|
||||||
])
|
])
|
||||||
|
|
||||||
def test_parametrize_indirect_bad_arg(self, testdir):
|
def test_parametrize_indirect_list_error(self, testdir):
|
||||||
testdir.makepyfile("""
|
def func(x, y): pass
|
||||||
import pytest
|
metafunc = self.Metafunc(func)
|
||||||
@pytest.fixture(scope='function')
|
pytest.raises(ValueError, lambda:
|
||||||
def x(request):
|
metafunc.parametrize('x, y', [('a', 'b')], indirect=['x', 'z']))
|
||||||
return request.param * 3
|
|
||||||
@pytest.fixture(scope='function')
|
|
||||||
def y(request):
|
|
||||||
return request.param * 2
|
|
||||||
@pytest.mark.parametrize('x, y', [('a', 'b')], indirect=['x', 'z'])
|
|
||||||
def test_simple(x,y):
|
|
||||||
assert len(x) == 3
|
|
||||||
assert len(y) == 1
|
|
||||||
""")
|
|
||||||
result = testdir.runpytest("-v")
|
|
||||||
result.stdout.fnmatch_lines([
|
|
||||||
"*indirect: fixture 'z' doesn't exist*",
|
|
||||||
])
|
|
||||||
|
|
||||||
def test_addcalls_and_parametrize_indirect(self):
|
def test_addcalls_and_parametrize_indirect(self):
|
||||||
def func(x, y): pass
|
def func(x, y): pass
|
||||||
|
|
Loading…
Reference in New Issue