Skip to content

Commit a211141

Browse files
committed
add tests for valuify
1 parent 3cfbc89 commit a211141

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

unpythonic/tests/test_funutil.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from functools import partial
88

99
# `Values` is also tested where function composition utilities that use it are.
10-
from ..funutil import call, callwith, Values
10+
from ..funutil import call, callwith, Values, valuify
1111

1212
def runtests():
1313
with testset("@call (def as code block)"):
@@ -138,6 +138,13 @@ def silly_but_legal():
138138
test[result.rets[0] == 42]
139139
test[result.ret == 42] # shorthand for single-value case
140140

141+
with testset("valuify (convert tuple as multiple-return-values into Values)"):
142+
@valuify
143+
def f(x, y, z):
144+
return x, y, z
145+
test[isinstance(f(1, 2, 3), Values)]
146+
test[f(1, 2, 3) == Values(1, 2, 3)]
147+
141148
if __name__ == '__main__': # pragma: no cover
142149
with session(__file__):
143150
runtests()

0 commit comments

Comments
 (0)