gpt4 book ai didi

fixtures - 课内或课外的pytest装置?

转载 作者:行者123 更新时间:2023-12-01 00:54:48 25 4
gpt4 key购买 nike

如果 fixture 在 Class(bla0, bla1) 的内部或外部,有什么区别?

@pytest.fixtures()
def bla0()
...

class MyTest:
@pytest.fixtures()
def bla1()
...

@pytest.mark.usefixtures("bla0", "bla1")
def test ...

最佳答案

只是可见性问题... bla1只能用于 MyTest 中声明的测试方法中.

关于fixtures - 课内或课外的pytest装置?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28811591/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com