Debian Codegraph @

examples/testing.py

raw symbols ◀ ▶
Source reconstructed at patch state 0 of 1 — not the installed (fully patched) source.
1 Debian patch touch this file
1 #!/usr/bin/python
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))