Hello, there,

My intuitive thought is that there are two types of tests in Leo,


1. Testing of common Python function script nodes,


2. Tests that require a Leo context, such as g, c, p, etc.

    2.1 Test with Leo already open, because there are already g, c, p

    2.2 Testing without Leo open. It is no different from a normal python 
program. e.g. 'python -m unittest'


For 1, if I have such a Leo script node, can I test it?


```
def add(a, b):
    return a + b

import unittest
class TestAddFunction(unittest.TestCase):

    def test_add(self):
        self.assertEqual(add(1, 2), 3)
        self.assertEqual(add(-1, 1), 0)
        self.assertEqual(add(-1, -1), -2)
```


For 2, Is this possible for the case in 2.1?


I flipped through the posts in the forums and it looked like there should 
be a 'test-' command, but I only had 'test-one' in my environment, nothing 
else. `execute-pytest` command also not works(maybe I am doing something 
wrong)


I failed to find anything in the documentation that made me start. Am I 
doing something wrong?



Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/65bb6dbb-d0a4-4c29-a382-940090eb4c91n%40googlegroups.com.

Reply via email to