diff options
Diffstat (limited to 'tests/pyscript')
-rw-r--r-- | tests/pyscript/py_locals.py | 5 | ||||
-rw-r--r-- | tests/pyscript/self_in_py.py | 6 |
2 files changed, 11 insertions, 0 deletions
diff --git a/tests/pyscript/py_locals.py b/tests/pyscript/py_locals.py new file mode 100644 index 00000000..16cb6926 --- /dev/null +++ b/tests/pyscript/py_locals.py @@ -0,0 +1,5 @@ +# flake8: noqa F821 +# Tests how much a pyscript can affect cmd2.Cmd.py_locals + +del [locals()["test_var"]] +my_list.append(2) diff --git a/tests/pyscript/self_in_py.py b/tests/pyscript/self_in_py.py new file mode 100644 index 00000000..f0f6271a --- /dev/null +++ b/tests/pyscript/self_in_py.py @@ -0,0 +1,6 @@ +# flake8: noqa F821 +# Tests self_in_py in pyscripts +if 'self' in globals(): + print("I see self") +else: + print("I do not see self") |