Maybe it would be possible to create a decorator which wrapped a bare function and assert and generated a standard unittest class/method out of it. It would require importing the decorator and decorating the function, obviously. Maybe it would look something like this:
from green import testme
@testme
def myfunc():
assert foo == bar, "foo = bar"
Maybe that could return a wrapped version of the function that would be semantically equivalent to:
import unittest
class TestMyfunc(unittest.TestCase):
def test_myfunc(self):
# XXX Call myfunc() and translate its behavior into unittest XXX
Maybe it would be possible to create a decorator which wrapped a bare function and assert and generated a standard unittest class/method out of it. It would require importing the decorator and decorating the function, obviously. Maybe it would look something like this:
Maybe that could return a wrapped version of the function that would be semantically equivalent to: