[ZCM] [ZC] 2276/ 2 Comment "Zope 2 test.py and eggs"
"Collector: Zope Bugs, Features, and Patches ..." <[email protected]> Tue, 06 Feb 2007 19:37:53 -0500
| Newsgroups | gmane.comp.web.zope.devel.collector-monitor |
|---|---|
| Message-ID | <[email protected]> |
Issue #2276 Update (Comment) "Zope 2 test.py and eggs" Status Pending, Zope/bug medium To followup, visit: http://www.zope.org/Collectors/Zope/2276 ============================================================== = Comment - Entry #2 by philikon on Feb 6, 2007 7:37 pm I don't think I like point 1). I want scripts like test.py to make sure that they take their associated sandbox OVER anything I've set in my PYTHONPATH. That's why I think it makes sense that they prepend to sys.path. ________________________________________ = Request - Entry #1 by nouri on Feb 6, 2007 6:47 pm Uploaded: "test.py.diff" - http://www.zope.org/Collectors/Zope/2276/test.py.diff/view Attached is quite a small patch to test.py that does two things: 1) It appends the SOFTWARE_HOME path to the end of sys.path, instead of putting it in front of other paths. This allows subpackages of the 'Products' namespace package to be found. 2) It adds default arguments to the testrunner in the test.py script so that other paths in sys.path that start with the instance's home path are included in the --test-path arguments to the testrunner. This allows tests from eggs that are installed in the instance's lib/python to be run. I'm not exactly sure about the implications of (1), but (2) certainly is a big step towards comfortable working with Zope 2 in a workingenv or virtual-python setting. I think the performance impact of searching those additional directories (if they are there at all) can be neglected. ==============================================================