468,738 Members | 1,791 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,738 developers. It's quick & easy.

Puzzled by py.test output

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

--
Jan Decaluwe - Resources bvba - http://www.jandecaluwe.com
Losbergenlaan 16, B-3010 Leuven, Belgium
From Python to silicon:
http://myhdl.jandecaluwe.com
Jan 18 '06 #1
0 840

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by Robin Becker | last post: by
4 posts views Thread by Philip Yale | last post: by
27 posts views Thread by Josh | last post: by
reply views Thread by alexandre_irrthum | last post: by
6 posts views Thread by =?Utf-8?B?QkJN?= | last post: by
1 post views Thread by rich_sposato | last post: by
3 posts views Thread by lenygold via DBMonster.com | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.