[py-svn] r36387 - in py/dist/py: . misc/testing
hpk at codespeak.net
hpk at codespeak.net
Tue Jan 9 19:18:05 CET 2007
Author: hpk
Date: Tue Jan 9 19:18:04 2007
New Revision: 36387
Modified:
py/dist/py/initpkg.py
py/dist/py/misc/testing/test_api.py
Log:
forget about trying to fix __module__ and __name__
of exported classes for now.
Modified: py/dist/py/initpkg.py
==============================================================================
--- py/dist/py/initpkg.py (original)
+++ py/dist/py/initpkg.py Tue Jan 9 19:18:04 2007
@@ -182,10 +182,10 @@
result = self.__package__._resolve(extpy)
del self.__map__[name]
setattr(self, name, result)
- self._fixinspection(result, name)
+ #self._fixinspection(result, name)
return result
- def _fixinspection(self, result, name):
+ def _deprecated_fixinspection(self, result, name):
# modify some attrs to make a class appear at export level
if hasattr(result, '__module__'):
if not result.__module__.startswith('py.__'):
Modified: py/dist/py/misc/testing/test_api.py
==============================================================================
--- py/dist/py/misc/testing/test_api.py (original)
+++ py/dist/py/misc/testing/test_api.py Tue Jan 9 19:18:04 2007
@@ -14,7 +14,6 @@
assert_class('py.path', 'checker')
def test_magic_entrypoints(self):
- assert_class('py.magic', 'View')
assert_function('py.magic', 'invoke')
assert_function('py.magic', 'revoke')
assert_function('py.magic', 'patch')
@@ -31,10 +30,14 @@
def assert_class(modpath, name):
mod = __import__(modpath, None, None, [name])
obj = getattr(mod, name)
- fullpath = modpath + '.' + name
- assert obj.__module__ == modpath
- if sys.version_info >= (2,3):
- assert obj.__name__ == name
+ assert inspect.isclass(obj)
+
+ # we don't test anymore that the exported classes have
+ # the exported module path and name on them.
+ #fullpath = modpath + '.' + name
+ #assert obj.__module__ == modpath
+ #if sys.version_info >= (2,3):
+ # assert obj.__name__ == name
def assert_function(modpath, name):
mod = __import__(modpath, None, None, [name])
More information about the py-svn
mailing list