diff --git a/examples/decorator/tests/example.py b/examples/decorator/tests/example.py new file mode 100644 index 00000000..5725a2ed --- /dev/null +++ b/examples/decorator/tests/example.py @@ -0,0 +1,11 @@ +@Counter +def say_hello(): + print("hello") + + +say_hello() +say_hello() +say_hello() +say_hello() + +assert say_hello.count == 4 diff --git a/guide/src/class/call.md b/guide/src/class/call.md index 6f7d1e03..c9fe1217 100644 --- a/guide/src/class/call.md +++ b/guide/src/class/call.md @@ -21,7 +21,7 @@ An example crate containing this pyclass can be found [here](https://github.com/ Python code: ```python -{{#include ../../../examples/decorator/src/test.py}} +{{#include ../../../examples/decorator/tests/example.py}} ``` Output: