Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doctest bug #43331

Closed
stnsls mannequin opened this issue May 8, 2006 · 1 comment
Closed

Doctest bug #43331

stnsls mannequin opened this issue May 8, 2006 · 1 comment
Labels
stdlib Python modules in the Lib dir

Comments

@stnsls
Copy link
Mannequin

stnsls mannequin commented May 8, 2006

BPO 1483785
Files
  • Spyca.py
  • spycacreatedb.sql
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2006-05-08.13:07:55.000>
    created_at = <Date 2006-05-08.12:53:20.000>
    labels = ['library']
    title = 'Doctest bug'
    updated_at = <Date 2006-05-08.13:07:55.000>
    user = 'https://bugs.python.org/stnsls'

    bugs.python.org fields:

    activity = <Date 2006-05-08.13:07:55.000>
    actor = 'stnsls'
    assignee = 'none'
    closed = True
    closed_date = None
    closer = None
    components = ['Library (Lib)']
    creation = <Date 2006-05-08.12:53:20.000>
    creator = 'stnsls'
    dependencies = []
    files = ['1994', '1995']
    hgrepos = []
    issue_num = 1483785
    keywords = []
    message_count = 1.0
    messages = ['28446']
    nosy_count = 1.0
    nosy_names = ['stnsls']
    pr_nums = []
    priority = 'normal'
    resolution = None
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue1483785'
    versions = ['Python 2.4']

    @stnsls
    Copy link
    Mannequin Author

    stnsls mannequin commented May 8, 2006

    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 ;)

    @stnsls stnsls mannequin closed this as completed May 8, 2006
    @stnsls stnsls mannequin added the stdlib Python modules in the Lib dir label May 8, 2006
    @stnsls stnsls mannequin closed this as completed May 8, 2006
    @stnsls stnsls mannequin added the stdlib Python modules in the Lib dir label May 8, 2006
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    stdlib Python modules in the Lib dir
    Projects
    None yet
    Development

    No branches or pull requests

    0 participants