Debian Codegraph @

examples/testing.py

raw symbols ◀ ▶ SCIP
1 Debian patch touch this file
•1 #!/usr/bin/python3
2 """
3 Demonstration of accessing wrapped functions for testing.
4 """
5
6 from __future__ import print_function
7
8 from crochet import setup, run_in_reactor
9 setup()
10
11 @run_in_reactor
12 def add(x, y):
13 return x + y
14
15
16 if __name__ == '__main__':
17 print("add(1, 2) returns EventualResult:")
18 print(" ", add(1, 2))
19 print("add.__wrapped__(1, 2) is the result of the underlying function:")
20 print(" ", add.__wrapped__(1, 2))