[svn r37463] test_get_initpkg_star_items() fails for me

when run as part of the whole py lib tests,
succeeds when ran as a single test.
Pruning sys.modules fixes this (but i am
not sure why the tracer depends on seeing
the import happen)

--HG--
branch : trunk
This commit is contained in:
hpk 2007-01-28 12:02:19 +01:00
parent de9fd5ecef
commit 15c1ebe506
1 changed files with 5 additions and 0 deletions

View File

@ -415,6 +415,11 @@ def setup_fs_project():
def setup_pkg_docstorage():
pkgdir, pkgname = setup_fs_project()
py.std.sys.path.insert(0, str(pkgdir))
# XXX test_get_initpkg_star_items depends on package not
# being imported already
for key in py.std.sys.modules.keys():
if key == pkgname or key.startswith(pkgname + "."):
del py.std.sys.modules[key]
pkg = __import__(pkgname)
ds = DocStorage().from_pkg(pkg)
return pkg, ds