[svn r37912] Made some small changes to the initpkg mechanism so docstrings are, if

provided in the exportdefs, copied to the namespaces (from whereever they
come), and added docstrings to all exposed namespaces (except for _thread for
now).

--HG--
branch : trunk
This commit is contained in:
guido
2007-02-04 15:27:10 +01:00
parent 4791dd6501
commit 7852ead1fe
15 changed files with 45 additions and 15 deletions

View File

@@ -127,12 +127,15 @@ class TestRealModule:
tfile.write(py.code.Source("""
import py
py.initpkg('realtest', {
'x.module.__doc__': ('./testmodule.py', '__doc__'),
'x.module': ('./testmodule.py', '*'),
})
"""))
tfile = pkgdir.join('testmodule.py')
tfile.write(py.code.Source("""
'test module'
__all__ = ['mytest0', 'mytest1', 'MyTest']
def mytest0():
@@ -186,6 +189,11 @@ class TestRealModule:
assert 'mytest1' in moddict
assert 'MyTest' in moddict
def test_realmodule___doc__(self):
"""test whether the __doc__ attribute is set properly from initpkg"""
import realtest.x.module
assert realtest.x.module.__doc__ == 'test module'
#class TestStdHook:
# """Tests imports for the standard Python library hook."""
#