Skip to content

Commit

Permalink
add failing test for pytest-dev#3605
Browse files Browse the repository at this point in the history
  • Loading branch information
RonnyPfannschmidt committed Jun 20, 2018
1 parent e86fe38 commit cab707c
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions testing/test_mark.py
Original file line number Diff line number Diff line change
Expand Up @@ -1132,3 +1132,41 @@ def test_addmarker_getmarker():
node.add_marker("b")
node.get_marker("a").combined
node.get_marker("b").combined


@pytest.mark.issue("https://github.com/pytest-dev/pytest/issues/3605")
def test_markers_from_parametrize(testdir):
testdir.makepyfile(
"""
from __future__ import print_function
import pytest
first_custom_mark = pytest.mark.custom_marker
custom_mark = pytest.mark.custom_mark
@pytest.fixture(autouse=True)
def trigger(request):
custom_mark =request.node.get_marker('custom_mark')
print("Custom mark %s" % custom_mark)
@custom_mark("custom mark non parametrized")
def test_custom_mark_non_parametrized():
print("Hey from test")
@pytest.mark.parametrize(
"obj_type",
[
first_custom_mark("first custom mark")("template"),
pytest.param( # Think this should be recommended way?
"disk",
marks=custom_mark('custom mark1')
),
custom_mark("custom mark2")("vm"), # Tried also this
]
)
def test_custom_mark_parametrized(obj_type):
print("obj_type is:", obj_type)
"""
)

result = testdir.runpytest()
result.assertoutcome(failed=0)

0 comments on commit cab707c

Please sign in to comment.