Fix custom name for yield_fixtures
This commit is contained in:
@@ -2693,15 +2693,14 @@ class TestContextManagerFixtureFuncs:
|
||||
*test_yields*:2*
|
||||
""")
|
||||
|
||||
# TODO: yield_fixture should work as well (this is bugged right now)
|
||||
def test_custom_name(testdir):
|
||||
testdir.makepyfile("""
|
||||
import pytest
|
||||
@pytest.fixture(name='meow')
|
||||
def arg1():
|
||||
return 'mew'
|
||||
def test_1(meow):
|
||||
print(meow)
|
||||
""")
|
||||
result = testdir.runpytest("-s")
|
||||
result.stdout.fnmatch_lines("*mew*")
|
||||
def test_custom_name(self, testdir, flavor):
|
||||
testdir.makepyfile("""
|
||||
import pytest
|
||||
@pytest.{flavor}(name='meow')
|
||||
def arg1():
|
||||
return 'mew'
|
||||
def test_1(meow):
|
||||
print(meow)
|
||||
""".format(flavor=flavor))
|
||||
result = testdir.runpytest("-s")
|
||||
result.stdout.fnmatch_lines("*mew*")
|
||||
|
||||
Reference in New Issue
Block a user