ANN: PyUnitTestBrowser 002

Syver Enstad syver-en+usenet at online.no
Fri May 31 18:21:34 EDT 2002


phlip_cpp at yahoo.com (Phlip) writes:
> 
> The latest version appears to work on an MS Windows box, and has a few
> fixes.
> 
> 
> If an error occurs, you can surf to the error point automatically with
> Vim.

This seems to work much better on win32. 

There are still two failures, (one of them is maybe designed to fail
to test that the bar is orange, I don't know).

For the my doc test the content of source on my machine:
('D:\\devtools\\Python22\\Lib\\site-packages\\browser\\test_browser.py',
246)

May I suggest something like this (which avoids the failure by
removing the path part of the path):

if aTest.getName() == 'test_getDoc':
    source = aTest.getSourceLocation()
    file = os.path.split(source[0])[1] # added line
    source = (file, source[1])         # added line

It seems like the problem is the same for the second failure.

It seems that these failures only occur when launching the browser.py
script via it's python extension (ShellExecute, start, Start -> Run),
and not when launching via python browser.py, so it might not be a
problem.

Have you any hints on how to hack browser.py so that it run
unittest.TestCase derived classes in a file without a suite method
that generates it?




======================================================================
FAIL: test_OrangeBar (test_browser.BrowserTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "D:\devtools\Python22\Lib\site-packages\browser\test_browser.py", line 15
2, in test_OrangeBar
    self.assert_(calls[2].params == either or calls[2].params == ore)
  File "d:\devtools\python22\lib\unittest.py", line 262, in failUnless
    if not expr: raise self.failureException, msg
AssertionError

======================================================================
FAIL: my doc
----------------------------------------------------------------------
Traceback (most recent call last):
  File "D:\devtools\Python22\Lib\site-packages\browser\test_browser.py", line 29
1, in test_getDoc
    self.assert_(source == either or source == ore)
  File "d:\devtools\python22\lib\unittest.py", line 262, in failUnless
    if not expr: raise self.failureException, msg
AssertionError

----------------------------------------------------------------------



-- 

Vennlig hilsen 

Syver Enstad



More information about the Python-list mailing list