This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Doctest bug
Type: Stage:
Components: Library (Lib) Versions: Python 2.4
process
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: stnsls
Priority: normal Keywords:

Created on 2006-05-08 12:53 by stnsls, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
Spyca.py stnsls, 2006-05-08 12:53
spycacreatedb.sql stnsls, 2006-05-08 13:07
Messages (1)
msg28446 - (view) Author: stnsls (stnsls) Date: 2006-05-08 12:53
When i run doctest on the module, i get that error: 
 
 
 
[sm@localhost Spyca]$ python Spyca.py 
********************************************************************** 
File "Spyca.py", line 840, in 
__main__.City.Select_all 
Failed example: 
    print City.Select_all(Country.Get_rowid('<default 
country>')) 
Exception raised: 
    Traceback (most recent call last): 
      File "/usr/lib/python2.4/doctest.py", line 
1243, in __run 
        compileflags, 1) in test.globs 
      File "<doctest __main__.City.Select_all[0]>", 
line 1, in ? 
        print 
City.Select_all(Country.Get_rowid('<default 
country>')) 
      File "Spyca.py", line 846, in Select_all 
        return [cls(i) for i in 
Db.Exec(sql).fetchall()] 
      File "Spyca.py", line 760, in __init__ 
        elif isinstance(this, tuple) or 
isinstance(this, list): self.Select_seq(this) 
      File "Spyca.py", line 817, in Select_seq 
        if not isinstance(seq[3], Latitude): raise 
SpycaException(SpycaInitError, type(seq[3])) 
    SpycaException: Instanciation or argument error. 
[<type 'unicode'>] 
********************************************************************** 
1 items had failures: 
   1 of   1 in __main__.City.Select_all 
***Test Failed*** 1 failures. 
 
 
 
Now, when i do all the same in the interpreter: 
 
 
 
 
[sm@localhost Spyca]$ python 
Python 2.4.1 (#2, Aug 25 2005, 18:20:57) 
[GCC 4.0.1 (4.0.1-2mdk for Mandriva Linux release 
2006.0)] on linux2 
Type "help", "copyright", "credits" or "license" for 
more information. 
>>> import Spyca as S 
>>> lat = S.Latitude() 
>>> lon = S.Longitude() 
>>> seq = (None, 'myCity', None, lat, lon, 0, '') 
>>> c = S.City(seq) 
>>> print c 
myCity 
>>> repr(c) 
"[None, 'myCity', None, [0, 0 ,0, 0.0], [0, 0 ,0, 
0.0], 0, '']" 
>>> 
 
 
 
As you can see, no error in the interpreter. 
 
 
-------- 
Have a nice day. Thanks for the best scripting 
language ;) 
 
History
Date User Action Args
2022-04-11 14:56:17adminsetgithub: 43331
2006-05-08 12:53:20stnslscreate