Fix --setup-only and --setup-show for custom pytest items

Fix #5884
This commit is contained in:
Bruno Oliveira
2019-09-28 11:52:09 -03:00
parent 6bfd30d169
commit 7bdfba3578
5 changed files with 36 additions and 8 deletions

View File

@@ -6,8 +6,8 @@ def mode(request):
return request.param
def test_show_only_active_fixtures(testdir, mode):
p = testdir.makepyfile(
def test_show_only_active_fixtures(testdir, mode, dummy_yaml_custom_test):
testdir.makepyfile(
'''
import pytest
@pytest.fixture
@@ -21,7 +21,7 @@ def test_show_only_active_fixtures(testdir, mode):
'''
)
result = testdir.runpytest(mode, p)
result = testdir.runpytest(mode)
assert result.ret == 0
result.stdout.fnmatch_lines(

View File

@@ -1,6 +1,6 @@
def test_show_fixtures_and_test(testdir):
def test_show_fixtures_and_test(testdir, dummy_yaml_custom_test):
""" Verifies that fixtures are not executed. """
p = testdir.makepyfile(
testdir.makepyfile(
"""
import pytest
@pytest.fixture
@@ -11,7 +11,7 @@ def test_show_fixtures_and_test(testdir):
"""
)
result = testdir.runpytest("--setup-plan", p)
result = testdir.runpytest("--setup-plan")
assert result.ret == 0
result.stdout.fnmatch_lines(