Unverified 提交 16d1cbe4 authored 作者: Maxim Kochurov's avatar Maxim Kochurov 提交者: GitHub

improve error message in function graph tests (#108)

上级 d9fe1974
......@@ -42,17 +42,23 @@ class TestFunctionGraph:
var1 = op1()
var2 = op2()
with pytest.raises(TypeError):
with pytest.raises(TypeError, match="'Variable' object is not iterable"):
FunctionGraph(var1, [var2])
with pytest.raises(TypeError):
with pytest.raises(TypeError, match="'Variable' object is not reversible"):
FunctionGraph([var1], var2)
with pytest.raises(ValueError):
with pytest.raises(
ValueError,
match=(
"One of the provided inputs is the output of an already existing node. "
"If that is okay, either discard that input's owner or use graph.clone."
),
):
var3 = op1(var1)
FunctionGraph([var3], [var2], clone=False)
with pytest.raises(ValueError):
with pytest.raises(ValueError, match="No outputs specified"):
var3 = op1(var1)
FunctionGraph([var3], clone=False)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论