2024-04-25 15:14:04 发布
网友
我试图学习pytest,但我很难理解parameterize()的行为。在
import pytest @pytest.mark.parameterize("foo", [1, 2, 3, 4, 5, 6, 7, ]) def test(foo): assert foo % 2 == 0
跑步py.测试返回错误:“fixture”foo“not found”。在
运行这个几乎完全相同的示例代码工作得非常好!有什么区别,为什么我使用参数化的尝试失败了?在
不幸的是,这只是parametrize单词中的一个错误
parametrize
import pytest @pytest.mark.parametrize("foo", [1, 2, 3, 4, 5, 6, 7, ]) def test(foo): assert foo % 2 == 0
效果很好。在
不幸的是,这只是
parametrize
单词中的一个错误效果很好。在
相关问题 更多 >
编程相关推荐