Hi All, just updated one of my packages buildouts and tried to run the tests, I got: $ bin/test Test-module import failures: Module: mortar.tests.test_docs ValueError: Module-relative files may not have absolute paths Running zope.testing.testrunner.layer.UnitTests tests: Set up zope.testing.testrunner.layer.UnitTests in 0.000 seconds. Ran 42 tests with 0 failures and 0 errors in 0.023 seconds. To try and figure out where this rather unhelpful message (which doesn't occur when the same tests are run with the same versions of all eggs on Windows) was coming from, I tried: $ bin/test -D Traceback (most recent call last): File "bin/test", line 28, in <module> <snip> "/home/chris/buildout-eggs/zope.testing-3.8.0-py2.6.egg/zope/testing/testrunner/find.py", line 95, in __init__ raise TypeError('If post_mortem is specified, ' TypeError: If post_mortem is specified, full exc_info must be passed! No idea what this means either... anyone? Chris -- Simplistix - Content Management, Batch Processing & Python Consulting - http://www.simplistix.co.uk
Hi Christian, In trying to debug this: Chris Withers wrote:
$ bin/test -D Traceback (most recent call last): File "bin/test", line 28, in <module> <snip> "/home/chris/buildout-eggs/zope.testing-3.8.0-py2.6.egg/zope/testing/testrunner/find.py", line 95, in __init__ raise TypeError('If post_mortem is specified, ' TypeError: If post_mortem is specified, full exc_info must be passed!
...I discovered that the exc_info is being cut to bits in find_suites: except: suite = StartUpFailure( options, module_name, sys.exc_info()[:2]+(None,)) ...which svn blame attributes to you. Any idea why this is being done? Changing the above to: suite = StartUpFailure( options, module_name, sys.exc_info()) ...appears to have no effect other than making post mortem debugging work and actually showing the traceback when the exception occurs, which both seem like a good thing to me. Can you or anyone else shed some light on this? Chris -- Simplistix - Content Management, Batch Processing & Python Consulting - http://www.simplistix.co.uk
Chris Withers wrote:
ValueError: Module-relative files may not have absolute paths
Okay, so this is because the check is this little gem: if path.startswith('/'): raise ValueError, 'Module-relative files may not have absolute paths' Cross platform FAIL :-( A few questions: - how can this actually be written in a cross platform way? Absolute paths start with a drive letter on Windows, no? - why are absolute paths bad here anyway? The code that causes this problem was: return DocFileSuite( optionflags=REPORT_NDIFF|ELLIPSIS, *glob(join(dirname(__file__),pardir,'docs','*.txt')) ) I have a nagging feeling this has come up before, but still, the above seems to be viable if maybe not preferred? - where do I report the cross platform bug? Python core tracker? What about zope.testing? Where does its tracker live now? cheers, Chris -- Simplistix - Content Management, Batch Processing & Python Consulting - http://www.simplistix.co.uk
On Tue, Aug 11, 2009 at 3:57 PM, Chris Withers<chris@simplistix.co.uk> wrote:
Chris Withers wrote:
ValueError: Module-relative files may not have absolute paths
Okay, so this is because the check is this little gem:
if path.startswith('/'): raise ValueError, 'Module-relative files may not have absolute paths'
Cross platform FAIL :-(
A few questions:
- how can this actually be written in a cross platform way? Absolute paths start with a drive letter on Windows, no?
os.path.isabs(path)
- why are absolute paths bad here anyway? The code that causes this problem was:
return DocFileSuite( optionflags=REPORT_NDIFF|ELLIPSIS, *glob(join(dirname(__file__),pardir,'docs','*.txt')) )
I have a nagging feeling this has come up before, but still, the above seems to be viable if maybe not preferred?
Looks too complicated and yes that check looks redundant to me.
- where do I report the cross platform bug? Python core tracker? What about zope.testing? Where does its tracker live now?
Gediminas Paulauskas wrote:
Done: https://bugs.launchpad.net/zope.testing/+bug/413685 http://bugs.python.org/issue6703 cheers, Chris -- Simplistix - Content Management, Batch Processing & Python Consulting - http://www.simplistix.co.uk
participants (2)
-
Chris Withers -
Gediminas Paulauskas