rework Node.add_marker parameter list and docstring
This commit is contained in:
parent
9a7c3a65f4
commit
b0ec442d24
|
@ -287,7 +287,11 @@ class MarkInfo(object):
|
|||
def validate_marks(self, attribute, value):
|
||||
for item in value:
|
||||
if not isinstance(item, Mark):
|
||||
raise ValueError(item)
|
||||
raise ValueError(
|
||||
"MarkInfo expects Mark instances, got {!r} ({!r})".format(
|
||||
item, type(item)
|
||||
)
|
||||
)
|
||||
|
||||
combined = attr.ib(
|
||||
repr=False,
|
||||
|
|
|
@ -173,12 +173,10 @@ class Node(object):
|
|||
chain.reverse()
|
||||
return chain
|
||||
|
||||
def add_marker(self, marker, append=True):
|
||||
def add_marker(self, marker):
|
||||
"""dynamically add a marker object to the node.
|
||||
|
||||
``marker`` can be a string or pytest.mark.* instance.
|
||||
``append=True`` whether to append the marker,
|
||||
if false insert at position 0
|
||||
:type marker: str or pytest.mark.*
|
||||
"""
|
||||
from _pytest.mark import MarkDecorator, MARK_GEN
|
||||
|
||||
|
|
Loading…
Reference in New Issue