On Tue, Apr 26, 2011 at 3:09 PM, Alexey U. Gudchenko <pr...@goodok.ru>wrote:

> 26.04.2011 08:20, smichr пишет:
>
> > can tests involing warnings be put in doctests rather than the test
> suite?
>
> > I prefer not to see warnings while running tests. Would it be a better
> > idea to put these in docstrings? Or perhaps some warnings management
> > could be done to change the warnings into exceptions:
> >
> >     [ http://docs.python.org/library/warnings.html ]
> >
>
> Hi!
>
> May be it is related with the issue 101 so I asked some questions.
>
> First of all what do you classify as warnings? I run ./bin/doctestand
> don't see warnings in master now. The only report with failed and passed
> tests.
>

OK, then maybe this is platform dependent...I am getting a warning when
running the tests of geometry:

    ============================= test process starts
==============================

    executable:   C:\Python27\python.exe  (2.7.1-final-0)
    ground types: python

    sympy\geometry\tests\test_geometry.py[9] ..ff..Warning: Polygons may
intersect p
    roducing erroneous output
    Warning: Polygons may intersect producing erroneous output
    ...                          [OK]

    ======== tests finished: 7 passed, 2 expected to fail, in 3.40 seconds
=========

Also, could you explain how do you imagine use-case with the warnings in
> details: how should it be formed in the docstring (by the some example)?
> E.g it may be sufficient to do not shaped at whole in the docstring as
> in the above example.
>
>
If everyone were getting the above warning then I would prefer that it be
raised in a doctest as you have done in your example. So the test suite
wouldn't raise the condition but the doctest (which captures the output)
would.


> And what is more significant, what should the reaction of ./bin/doctest
> be? Or should it be controlled by "-W" option?
>
> I'm not sure. I would just prefer not to see anything except failures
during testing. Maybe a -W could be used if you want to see the warnings.
But I'm not sure that would be necessary if the warnings module were used
(in the tests) to just convert the warning to an exception.

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To post to this group, send email to sympy@googlegroups.com.
To unsubscribe from this group, send email to 
sympy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sympy?hl=en.

Reply via email to