diff options
Diffstat (limited to 'tests/pyscript')
-rw-r--r-- | tests/pyscript/raises_exception.py | 6 | ||||
-rw-r--r-- | tests/pyscript/recursive.py | 11 | ||||
-rw-r--r-- | tests/pyscript/run.py | 6 | ||||
-rw-r--r-- | tests/pyscript/to_run.py | 2 |
4 files changed, 25 insertions, 0 deletions
diff --git a/tests/pyscript/raises_exception.py b/tests/pyscript/raises_exception.py new file mode 100644 index 00000000..738edaf2 --- /dev/null +++ b/tests/pyscript/raises_exception.py @@ -0,0 +1,6 @@ +#!/usr/bin/env python +# coding=utf-8 +""" +Example demonstrating what happens when a Python script raises an exception +""" +1 + 'blue' diff --git a/tests/pyscript/recursive.py b/tests/pyscript/recursive.py new file mode 100644 index 00000000..21550592 --- /dev/null +++ b/tests/pyscript/recursive.py @@ -0,0 +1,11 @@ +#!/usr/bin/env python +# coding=utf-8 +# flake8: noqa F821 +""" +Example demonstrating that calling run_pyscript recursively inside another Python script isn't allowed +""" +import os + +app.cmd_echo = True +my_dir = (os.path.dirname(os.path.realpath(sys.argv[0]))) +app('run_pyscript {}'.format(os.path.join(my_dir, 'stop.py'))) diff --git a/tests/pyscript/run.py b/tests/pyscript/run.py new file mode 100644 index 00000000..47250a10 --- /dev/null +++ b/tests/pyscript/run.py @@ -0,0 +1,6 @@ +# flake8: noqa F821 +import os + +app.cmd_echo = True +my_dir = (os.path.dirname(os.path.realpath(sys.argv[0]))) +run(os.path.join(my_dir, 'to_run.py')) diff --git a/tests/pyscript/to_run.py b/tests/pyscript/to_run.py new file mode 100644 index 00000000..b207952d --- /dev/null +++ b/tests/pyscript/to_run.py @@ -0,0 +1,2 @@ +# flake8: noqa F821 +print("I have been run") |