diff options
Diffstat (limited to 'Lib/test/test_funcattrs.py')
| -rw-r--r-- | Lib/test/test_funcattrs.py | 12 | 
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/test/test_funcattrs.py b/Lib/test/test_funcattrs.py index bd9caffd6f..b9b2e6e556 100644 --- a/Lib/test/test_funcattrs.py +++ b/Lib/test/test_funcattrs.py @@ -215,6 +215,17 @@ def test_func_closure():      verify(c[0].__class__.__name__ == "cell") # don't have a type object handy      cantset(f, "__closure__", c) +def test_empty_cell(): +    def f(): print(a) +    try: +        f.__closure__[0].cell_contents +    except ValueError: +        pass +    else: +        raise TestFailed("shouldn't be able to read an empty cell") + +    a = 12 +  def test_func_doc():      def f(): pass      verify(f.__doc__ is None) @@ -339,6 +350,7 @@ def test_im_name():  def testmore():      test_func_closure() +    test_empty_cell()      test_func_doc()      test_func_globals()      test_func_name()  | 
