From 2da19a6979679c5531580660bcfe66ac65ec313e Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Thu, 7 Nov 2013 10:09:45 +0100 Subject: [PATCH] fix test in older Py3.x versions, minor cleanups --- tests/run/ass2global.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/tests/run/ass2global.py b/tests/run/ass2global.py index c554125..4af1704 100644 --- a/tests/run/ass2global.py +++ b/tests/run/ass2global.py @@ -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 -- 2.7.4