有没有一种方法可以使用pytestfixture tmrdir编写类的测试方法?在文档中,它指定它可以与函数一起使用。 https://docs.pytest.org/en/latest/tmpdir.html
如果有一种方法可以为类中的测试方法传递tmpdir参数,请分享一个例子好吗?你知道吗
我尝试了以下操作,但出现了如下错误: ““
test_method() takes exactly 2 arguments (1 given)"
我的代码:
import pytest
class class_test(TestCase):
def test_method(self,tmpdir):
# code
请帮忙。你知道吗
目前没有回答
相关问题 更多 >
编程相关推荐