[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:
@@ -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."""
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user