I just realized that fixing the problem you reported is not going to be enough
to allow you to run py.test to test a fresh checkout of pylib. It's so because
of the following code, from py/path/local/local.py:

    def pyimport(self, modname=None, ensuresyspath=True):
        """ return path as an imported python module.
            if modname is None, look for the containing package
            and construct an according module name.
            The module will be put/looked up in sys.modules.
        """
        if not self.check():
            raise py.error.ENOENT(self)
        #print "trying to import", self
        pkgpath = None
        if modname is None:
            pkgpath = self.pypkgpath()
            if pkgpath is not None:
                if ensuresyspath:
                    self._prependsyspath(pkgpath.dirpath())
                pkg = __import__(pkgpath.basename, None, None, [])
                assert py.path.local(pkg.__file__).relto(pkgpath)

When we run "py.test <fresh-pypy-checkout>/py/test", pkgpath.basename will
be 'py' and the call to __import__() will return the already import py module
from /usr/lib/python2.X/site-packages/py. Then in the next line the assert
will fail because pkgpath is <fresh-pypy-checkout>/py and pkg.__file__ is
/usr/lib/python2.X/site-packages/py/__init__.pyc

I can probably think of some hacks to make this work, but I don't think
upstream will accept them, and I'm not sure it'd be worth maintaining them on
my side.

If you have any ideas on how to fix this on a non-hackish way I'll be glad to
send it upstream.

-- 
Guilherme Luis R. Salgado


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to