472,993 Members | 2,001 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,993 software developers and data experts.

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 905

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Robin Becker | last post by:
We've been queried about the randomness of some filenames we're producing. I worked through and seemed to satisfy myself that random is being initialised from the system time in C time(&now)...
0
by: Andrea M. Segovia | last post by:
I just compiled (but did not install) perl 5.8.0 on an SGI Origin 300 server (IP35) running IRIX 6.5.20m. Make test reported one test error, which I narrowed down to .../lib/ExUtils/t/Constant.t...
4
by: Philip Yale | last post by:
I'm hoping somebody can explain exactly what's going on here - I can't find it documented anywhere. Go to the Northwind database, and run the following SQL: create index IX_UnitPrice on...
27
by: Josh | last post by:
We have a program written in VB6 (over 100,000 lines of code and 230 UI screens) that we want to get out of VB and into a better language. The program is over 10 years old and has already been...
0
by: alexandre_irrthum | last post by:
Hi there, I am puzzled by the comportment of the line function from the ImageDraw module with regard to the way it draws or does not draw the last pixel of a line. Below I test this function...
6
by: =?Utf-8?B?QkJN?= | last post by:
Hi, I have an app that is crashing due to a System.ArgumentException. At this point it's just a simple app to test some basic object values. The main app is a Windows App that looks like...
1
by: rich_sposato | last post by:
I released version 2.0 of C++ Unit Test Library. You can download it from SourceForget.Net at http://sourceforge.net/projects/cppunittest/ .. I wrote this unit test library because other unit...
3
by: lenygold via DBMonster.com | last post by:
Here is the SP: --#SET TERMINATOR ! CREATE PROCEDURE execute_immediate (IN in_stmt VARCHAR(1000) ,OUT out_sqlcode INTEGER) LANGUAGE SQL MODIFIES SQL DATA BEGIN DECLARE sqlcode INTEGER;...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...
3
SueHopson
by: SueHopson | last post by:
Hi All, I'm trying to create a single code (run off a button that calls the Private Sub) for our parts list report that will allow the user to filter by either/both PartVendor and PartType. On...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.