本文整理汇总了Python中_pytest.mark.MarkGenerator类的典型用法代码示例。如果您正苦于以下问题:Python MarkGenerator类的具体用法?Python MarkGenerator怎么用?Python MarkGenerator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了MarkGenerator类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_pytest_mark_positional
def test_pytest_mark_positional(self):
mark = Mark()
def f():
pass
f = mark.world("hello")(f)
assert f.world.args[0] == "hello"
f = mark.world("world")(f)
示例2: test_pytest_mark_keywords
def test_pytest_mark_keywords(self):
mark = Mark()
def f():
pass
f = mark.world(x=3, y=4)(f)
assert f.world
assert f.world.kwargs['x'] == 3
assert f.world.kwargs['y'] == 4
示例3: test_pytest_mark_bare
def test_pytest_mark_bare(self):
mark = Mark()
def f():
pass
mark.hello(f)
assert f.hello
示例4: test_pytest_mark_positional_func_and_keyword
def test_pytest_mark_positional_func_and_keyword(self):
mark = Mark()
def f():
raise Exception
m = mark.world(f, omega="hello")
def g():
pass
assert m(g) != g
assert m(g).world.args[0] is f
assert m(g).world.kwargs["omega"] == "hello"
示例5: test_apply_multiple_and_merge
def test_apply_multiple_and_merge(self):
mark = Mark()
def f():
pass
mark.world
f = mark.world(x=3)(f)
assert f.world.kwargs['x'] == 3
f = mark.world(y=4)(f)
assert f.world.kwargs['x'] == 3
assert f.world.kwargs['y'] == 4
f = mark.world(y=1)(f)
assert f.world.kwargs['y'] == 1
assert len(f.world.args) == 0
示例6: test_apply_multiple_and_merge
def test_apply_multiple_and_merge(self):
mark = Mark()
def f():
pass
mark.world
mark.world(x=3)(f)
assert f.world.kwargs["x"] == 3
mark.world(y=4)(f)
assert f.world.kwargs["x"] == 3
assert f.world.kwargs["y"] == 4
mark.world(y=1)(f)
assert f.world.kwargs["y"] == 1
assert len(f.world.args) == 0