gump-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From leosim...@apache.org
Subject svn commit: r201593 - in /gump/branches/Gump3/bin/pylid-0.3/test/testUnit: getRanges.py matching.py
Date Fri, 24 Jun 2005 11:11:33 GMT
Author: leosimons
Date: Fri Jun 24 04:11:30 2005
New Revision: 201593

URL: http://svn.apache.org/viewcvs?rev=201593&view=rev
Log:
Make pylid tests work under python 2.4.

* bin/pylid-0.3/test/testUnit/matching.py,
  bin/pylid-0.3/test/testUnit/getRanges.py: python 2.4 does not consider 'if 1:' a statement
(I presume those are optimized out) to report on, which caused the following test failures
(linux 2.6, ubuntu hoary, python 2.4.1):

======================================================================
FAIL: test_getStats (test_coverage.uCoverage)
----------------------------------------------------------------------
Traceback (most recent call last):
  File /home/lsimons/svn/gump/branches/Gump3/bin/pylid-0.3/test/test_coverage.py, line 142,
in test_getStats
    self.failUnlessEqual(self.cov.getStats(), expected)
AssertionError: [('/home/lsimons/svn/gump/branches/Gump3/bin/pylid-0.3/test/testUnit/getStats.py',
{'ranges': [4], 'statementsRun': 3, 'coverage': 75.0, 'allStatements': 4}), ('/home/lsimons/svn/gump/branches/Gump3/bin/pylid-0.3/test/testUnit/getRanges.py',
{'ranges': [2, (13, 21), 27, (33, 42)], 'statementsRun': 19, 'coverage': 47.5, 'allStatements':
40})] != [('/home/lsimons/svn/gump/branches/Gump3/bin/pylid-0.3/test/testUnit/getStats.py',
{'ranges': [4], 'statementsRun': 3, 'coverage': 75.0, 'allStatements': 4}), ('/home/lsimons/svn/gump/branches/Gump3/bin/pylid-0.3/test/testUnit/getRanges.py',
{'ranges': [(13, 21), 27, (33, 42)], 'statementsRun': 20, 'coverage': 50.0, 'allStatements':
40})]

======================================================================
FAIL: test_matching (test_coverage.uCoverage)
----------------------------------------------------------------------
Traceback (most recent call last):
  File /home/lsimons/svn/gump/branches/Gump3/bin/pylid-0.3/test/test_coverage.py, line 120,
in test_matching
    self.failUnlessEqual(self.cov.statementsRun, self.cov.allStatements)
AssertionError: {'/home/lsimons/svn/gump/branches/Gump3/bin/pylid-0.3/test/testUnit/matching.py':
{1: 1, 2: 1, 3: 1, 4: 1, 6: 1, 7: 1, 8: 1, 9: 1, 10: 1, 11: 1, 12: 1, 13: 1, 14: 1, 15: 1,
16: 1, 18: 1, 19: 1, 20: 1, 21: 1, 22: 1, 23: 1, 24: 1, 25: 1, 26: 1, 27: 1, 28: 1, 29: 1,
30: 1, 31: 1, 32: 1, 33: 1, 34: 1, 35: 1, 36: 1}} != {'/home/lsimons/svn/gump/branches/Gump3/bin/pylid-0.3/test/testUnit/matching.py':
{1: 1, 2: 1, 3: 1, 4: 1, 6: 1, 7: 1, 8: 1, 9: 1, 10: 1, 11: 1, 12: 1, 13: 1, 14: 1, 15: 1,
16: 1, 17: 1, 18: 1, 19: 1, 20: 1, 21: 1, 22: 1, 23: 1, 24: 1, 25: 1, 26: 1, 27: 1, 28: 1,
29: 1, 30: 1, 31: 1, 32: 1, 33: 1, 34: 1, 35: 1, 36: 1}}

this is 'fixed' by using 'if 1 == 1' which is not optimized out. Problem remains that the
python trace functionality and trace.py seem not to be in perfect sync. While 'if 1:' is 'executable'
it *is not actually executed*. Hmprf.

Modified:
    gump/branches/Gump3/bin/pylid-0.3/test/testUnit/getRanges.py
    gump/branches/Gump3/bin/pylid-0.3/test/testUnit/matching.py

Modified: gump/branches/Gump3/bin/pylid-0.3/test/testUnit/getRanges.py
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/bin/pylid-0.3/test/testUnit/getRanges.py?rev=201593&r1=201592&r2=201593&view=diff
==============================================================================
--- gump/branches/Gump3/bin/pylid-0.3/test/testUnit/getRanges.py (original)
+++ gump/branches/Gump3/bin/pylid-0.3/test/testUnit/getRanges.py Fri Jun 24 04:11:30 2005
@@ -1,5 +1,5 @@
 def foo():
-    if 1:
+    if 1 == 1:
         1
         1
         1

Modified: gump/branches/Gump3/bin/pylid-0.3/test/testUnit/matching.py
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/bin/pylid-0.3/test/testUnit/matching.py?rev=201593&r1=201592&r2=201593&view=diff
==============================================================================
--- gump/branches/Gump3/bin/pylid-0.3/test/testUnit/matching.py (original)
+++ gump/branches/Gump3/bin/pylid-0.3/test/testUnit/matching.py Fri Jun 24 04:11:30 2005
@@ -14,7 +14,7 @@
         1
     if on:
         1
-    elif 1:
+    elif 1 == 1:
         1
     class bug:
         def __init__(self):



Mime
View raw message