diff options
author | Aurelien Campeas <aurelien.campeas@logilab.fr> | 2010-11-30 12:19:25 +0100 |
---|---|---|
committer | Aurelien Campeas <aurelien.campeas@logilab.fr> | 2010-11-30 12:19:25 +0100 |
commit | 419ccc94c73f7143ab7cca1fd03d70787428d097 (patch) | |
tree | 30dfff17477c2d3e1969cd27229991db9782b952 /test | |
parent | d76f9681147d4b4f676ed044bd5165aec180642b (diff) | |
download | logilab-common-419ccc94c73f7143ab7cca1fd03d70787428d097.tar.gz |
[decorators] prevent caching of decorator functions
Diffstat (limited to 'test')
-rw-r--r-- | test/unittest_decorators.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/unittest_decorators.py b/test/unittest_decorators.py index 0217067..a016027 100644 --- a/test/unittest_decorators.py +++ b/test/unittest_decorators.py @@ -43,6 +43,11 @@ class DecoratorsTC(TestCase): inst = MyClass() self.assertEqual(inst.foo(4), 16) + def test_cannot_cache_generator(self): + def foo(): + yield 42 + self.assertRaises(AssertionError, cached, foo) + def test_cached_preserves_docstrings_and_name(self): class Foo(object): @cached |