Bug in DocTests?

2 Aufrufe
Direkt zur ersten ungelesenen Nachricht

Joschua

ungelesen,
11.03.2010, 17:05:5211.03.10
an web2py-users
As example, when you look in the examples app in simple_examples.py
and you execute the doctest, the docstrings in the controller hello4,
hello5 and hello6 are recognized as doctests and passed. I think this
is a bug (or is the doctest / web2py not able to check that, >>>?)

mdipierro

ungelesen,
11.03.2010, 17:15:5411.03.10
an web2py-users
I think that's doctest doing. If there is no actual test but there is
a docstring, it is assumed "pass".
It may be web2py's too. I need to check.

Joschua

ungelesen,
13.03.2010, 06:23:0013.03.10
an web2py-users
yeah, that would be great, because it twist the facts.. ^^

mdipierro

ungelesen,
13.03.2010, 11:18:2813.03.10
an web2py-users
I looked into this. It is a python issue. The doctest API return '' if
no test or passed test and return !='' if test fails. web2py cannot
easily discriminate if a test is there and passes or there isn't any.
If you can find something more about this let me know.

Massimo

Joschua

ungelesen,
14.03.2010, 12:44:3614.03.10
an web2py-users
I looked into the python documentation and find DocTestFinder:

http://pygments.org/demo/3361/?style=fruity

My script will print:

Finding tests in sample
0
Finding tests in with_doctests
3

Maybie this could be used..

mdipierro

ungelesen,
14.03.2010, 16:14:1314.03.10
an web2py-users
fantastic. I am uploading the solution to trunk. Thank you.

Joschua

ungelesen,
20.03.2010, 18:17:0120.03.10
an web2py-users
thank you too ( for web2py :)

On 14 Mrz., 21:14, mdipierro <mdipie...@cs.depaul.edu> wrote:
> fantastic. I am uploading the solution to trunk. Thank you.
>
> On Mar 14, 11:44 am, Joschua <cit_corperat...@gmx.net> wrote:
>
> > I looked into the python documentation and find DocTestFinder:
>
> >http://pygments.org/demo/3361/?style=fruity
>
> > My script will print:
>
> > Finding tests in sample
> > 0
> > Finding tests in with_doctests
> > 3
>
> > Maybie this could be used..
>
> > On 13 Mrz., 17:18, mdipierro <mdipie...@cs.depaul.edu> wrote:
>

> > > I looked into this. It is a python issue. ThedoctestAPI return '' if


> > > no test or passed test and return !='' if test fails. web2py cannot
> > > easily discriminate if a test is there and passes or there isn't any.
> > > If you can find something more about this let me know.
>
> > > Massimo
>
> > > On Mar 13, 5:23 am, Joschua <cit_corperat...@gmx.net> wrote:
>
> > > > yeah, that would be great, because it twist the facts.. ^^
>
> > > > On 11 Mrz., 23:15, mdipierro <mdipie...@cs.depaul.edu> wrote:
>

> > > > > I think that'sdoctestdoing. If there is no actual test but there is


> > > > > a docstring, it is assumed "pass".
> > > > > It may be web2py's too. I need to check.
>
> > > > > On Mar 11, 4:05 pm, Joschua <cit_corperat...@gmx.net> wrote:
>
> > > > > > As example, when you look in the examples app in simple_examples.py

> > > > > > and you execute thedoctest, the docstrings in the controller hello4,


> > > > > > hello5 and hello6 are recognized as doctests and passed. I think this

> > > > > > is a bug (or is thedoctest/ web2py not able to check that, >>>?)

Joschua

ungelesen,
21.03.2010, 12:30:3421.03.10
an web2py-users
it works great, but when the doctests fails, the error message is:
Line 2, in /home/joschua/seetor/Code/web2py/applications/examples//
controllers/simple_examples.py in makejson.__doc__

the are two ways to solve this (the second slash after examples)
problem:

#1: change line 62 at /gluon/compileapp.py to "name = '%scontrollers/
%s.py in %s.__doc__' \", which is fairly ugly.

#2: remove the last slash at line 353 in gluon/main.py AND check all
files that use request.folder, that they work correctly. although I
think it would be better to not let a directory end with a slash in
source code, but to change this will maybie break other things.

On 14 Mrz., 21:14, mdipierro <mdipie...@cs.depaul.edu> wrote:

Joschua

ungelesen,
21.03.2010, 12:31:4621.03.10
an web2py-users
oh, btw. can you make me an editor at the web2py-book and how can i
contribute to the source?

mdipierro

ungelesen,
24.03.2010, 20:37:0224.03.10
an web2py-users
Yes. But I need you to register first and tell me your login email.
Email me personally about this.
Allen antworten
Antwort an Autor
Weiterleiten
0 neue Nachrichten