예제 #1
0
    def test_not_decorator(self):
        def g(a, b):
            return a - b

        g = lazy_function(g)

        self.assertIsInstance(g(1, 2), thunk)
예제 #2
0
def test_const(f, val):
    f = strict(lazy_function(f))

    assert isinstance(f(), thunk)
    assert f() == val
예제 #3
0
def test_not_decorator():
    def g(a, b):
        return a - b

    g = lazy_function(g)
    assert isinstance(g(1, 2), thunk)