I am trying to get nose working in leo. Has anyone else had success? 

Here are my experiments. 

I saved this @shadow nodetest.py: 

import nose

def addit(x,y):
    return x+y
def test_evens():
    for i in range(0, 5):
        yield check_it, i, 3
def check_it(x,y):
    assert x + x == addit(x,y)

 
If you you try to run this within Leo, Leo crashes (I think it is nosing 
around leo's code):

output=nose.main()
g.es(output)


So I went through a separate sh process: 

sh=g.importExtension("sh")
g.es(sh.nosetests("nosetest.py"))


That gives an error as well, but I get some output: 

exception executing script
ErrorReturnCode_1: 

  RAN: '/usr/local/bin/nosetests nosetest.py'

  STDOUT:


  STDERR:
FFF.F
======================================================================
FAIL: nosetest.test_addit(0, 3)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/nose/case.py", line 197, in 
runTest
    self.test(*self.arg)
  File "/data2/Soft/hack/Python/InteractivePyCourse/nosetest.py", line 9, 
in check_it
    assert x + x == addit(x,y)
AssertionError

======================================================================
FAIL: nosetest.test_addit(1, 3)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/nose/case.py", line 197, in 
runTest
  ... (1170 more, please see e.stderr)
--------------------
  line 308:                 self.process.stdout,
* line 309:                 self.process.stderr
  line 310:             )
  line 311:         


>From the bash prompt, I get: 

bill@bill-laptop$ nosetests nosetest.py
FFF.F
======================================================================
FAIL: nosetest.test_evens(0, 3)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/nose/case.py", line 197, in 
runTest
    self.test(*self.arg)
  File "/data2/Soft/hack/Python/InteractivePyCourse/nosetest.py", line 9, 
in check_it
    assert x + x == addit(x,y)
AssertionError

======================================================================
FAIL: nosetest.test_evens(1, 3)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/nose/case.py", line 197, in 
runTest
    self.test(*self.arg)
  File "/data2/Soft/hack/Python/InteractivePyCourse/nosetest.py", line 9, 
in check_it
    assert x + x == addit(x,y)
AssertionError

======================================================================
FAIL: nosetest.test_evens(2, 3)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/nose/case.py", line 197, in 
runTest
    self.test(*self.arg)
  File "/data2/Soft/hack/Python/InteractivePyCourse/nosetest.py", line 9, 
in check_it
    assert x + x == addit(x,y)
AssertionError

======================================================================
FAIL: nosetest.test_evens(4, 3)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/nose/case.py", line 197, in 
runTest
    self.test(*self.arg)
  File "/data2/Soft/hack/Python/InteractivePyCourse/nosetest.py", line 9, 
in check_it
    assert x + x == addit(x,y)
AssertionError

----------------------------------------------------------------------
Ran 5 tests in 0.002s

FAILED (failures=4)



-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to