Puzzled by py.test output

J

Jan Decaluwe

I'm seeing a strange difference between error reporting
on local versus global variables, when using py.test.
Upon error, the actual value of a local is reported, but
not of a global. Does anyone know why? I'm using
the latest development version of py.test (from subversion).

Example code in file test.py:

--
def test_h():
h = 0
assert h == 1

g = 0
def test_g():
assert g == 1
--

py.test output:

============================= test process starts ========
testing-mode: inprocess
executable: /usr/local/bin/python (2.4.2-final-0)
using py lib: /usr/local/lib/python2.4/site-packages/py <rev unknown>

test.py[2] FF

______________________________________________________
_____________________________ entrypoint: test_h ______

def test_h():
h = 0
E assert h == 1
> assert 0 == 1

[/home/jand/project/myhdl/example/cookbook/stopwatch/test.py:3]
____________________________________________________
_____________________________ entrypoint: test_g __
def test_g():
E assert g == 1
> assert g == 1

[/home/jand/project/myhdl/example/cookbook/stopwatch/test.py:7]
_____________________________________________________________
================== tests finished: 2 failed in 0.02 seconds ==

Regards,

Jan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,017
Latest member
GreenAcreCBDGummiesReview

Latest Threads

Top