Commit 6b1a58c9 authored by Stefan Behnel's avatar Stefan Behnel

extend tests for new generator properties

parent 4716e1e7
......@@ -55,6 +55,34 @@ def attributes():
'<lambda>'
>>> y.__qualname__
'attributes.<locals>.inner.<locals>.<lambda>'
>>> y.__name__ = 123
Traceback (most recent call last):
TypeError: __name__ must be set to a string object
>>> y.__name__
'<lambda>'
>>> y.__qualname__ = None
Traceback (most recent call last):
TypeError: __qualname__ must be set to a string object
>>> y.__qualname__
'attributes.<locals>.inner.<locals>.<lambda>'
>>> y.__name__ = 'abc'
>>> y.__name__
'abc'
>>> y.__name__ = None
Traceback (most recent call last):
TypeError: __name__ must be set to a string object
>>> y.__name__
'abc'
>>> y.__qualname__ = 'huhu'
>>> y.__qualname__
'huhu'
>>> y.__qualname__ = 123
Traceback (most recent call last):
TypeError: __qualname__ must be set to a string object
>>> y.__qualname__
'huhu'
"""
def inner():
return (lambda : (yield 1))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment