From 15c1ebe506da2c33cfa550502689a41bf3d264ba Mon Sep 17 00:00:00 2001 From: hpk Date: Sun, 28 Jan 2007 12:02:19 +0100 Subject: [PATCH] [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 --- py/apigen/tracer/testing/test_docgen.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/py/apigen/tracer/testing/test_docgen.py b/py/apigen/tracer/testing/test_docgen.py index 5ddcbb39b..89e2236cb 100644 --- a/py/apigen/tracer/testing/test_docgen.py +++ b/py/apigen/tracer/testing/test_docgen.py @@ -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