fix test in older Py3.x versions, minor cleanups
authorStefan Behnel <stefan_ml@behnel.de>
Thu, 7 Nov 2013 09:09:45 +0000 (10:09 +0100)
committerStefan Behnel <stefan_ml@behnel.de>
Thu, 7 Nov 2013 09:09:45 +0000 (10:09 +0100)
tests/run/ass2global.py

index c554125..4af1704 100644 (file)
@@ -1,17 +1,15 @@
-__doc__ = u"""
+"""
     >>> getg()
     5
-    >>> f(42)
+    >>> setg(42)
     >>> getg()
     42
-    >>> global_in_class
-    9
 """
 
 g = 5
 
 
-def f(a):
+def setg(a):
     global g
     g = a
 
@@ -21,5 +19,15 @@ def getg():
 
 
 class Test(object):
+    """
+    >>> global_in_class
+    9
+    >>> Test.global_in_class
+    Traceback (most recent call last):
+    AttributeError: type object 'Test' has no attribute 'global_in_class'
+    >>> Test().global_in_class
+    Traceback (most recent call last):
+    AttributeError: 'Test' object has no attribute 'global_in_class'
+    """
     global global_in_class
     global_in_class = 9