Puzzled by py.test output

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jan Decaluwe

    #1

    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[color=blue]
    > assert 0 == 1[/color]

    [/home/jand/project/myhdl/example/cookbook/stopwatch/test.py:3]
    _______________ _______________ _______________ _______
    _______________ ______________ entrypoint: test_g __
    def test_g():
    E assert g == 1[color=blue]
    > assert g == 1[/color]

    [/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:

Working...