[Python-checkins] cpython: Remove more Python 2 code from unittest.mock (obsolete function attributes)

michael.foord python-checkins at python.org
Sun Mar 25 20:16:09 CEST 2012


http://hg.python.org/cpython/rev/91bd46503ede
changeset:   75930:91bd46503ede
user:        Michael Foord <michael at voidspace.org.uk>
date:        Sun Mar 25 19:16:10 2012 +0100
summary:
  Remove more Python 2 code from unittest.mock (obsolete function attributes)

files:
  Lib/unittest/mock.py |  14 --------------
  1 files changed, 0 insertions(+), 14 deletions(-)


diff --git a/Lib/unittest/mock.py b/Lib/unittest/mock.py
--- a/Lib/unittest/mock.py
+++ b/Lib/unittest/mock.py
@@ -2037,10 +2037,6 @@
             # MagicMock already does the useful magic methods for us
             continue
 
-        if isinstance(spec, FunctionTypes) and entry in FunctionAttributes:
-            # allow a mock to actually be a function
-            continue
-
         # XXXX do we need a better way of getting attributes without
         # triggering code execution (?) Probably not - we need the actual
         # object to mock it so we would rather trigger a property than mock
@@ -2128,16 +2124,6 @@
     type(_ANY.__eq__),
 )
 
-FunctionAttributes = set([
-    'func_closure',
-    'func_code',
-    'func_defaults',
-    'func_dict',
-    'func_doc',
-    'func_globals',
-    'func_name',
-])
-
 
 file_spec = None
 

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list