Hi, 2011/4/26 Alexey U. Gudchenko <pr...@goodok.ru>
> 26.04.2011 23:47, Chris Smith пишет: > > 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 >> ========= >> > > > Yes, I see that there is this line (#373) in the code of > "sympy/geometry/polygon.py" : > > print("Warning: Polygons may intersect producing erroneous output") > > That's why: > > > > I still get the warning: > > > It is better to use "warning.warn" standard procedure. (I think issue must > created for it in any case) > > Only then we can manage with those messages (e.g. as I described in other > messages) or at least discussed how to manage. > > > > > >> 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. >> >> > I think, the warnings are needed for the warn notifications. > So they are meaningless if they are suppressed by default. > > But in any case, they must be handled correctly in the report's display > output . Not as the dust text as now. > > E.g. marked as "W" symbol (like ".", "F", "X", "s") and with the statistic > printed in the report's summary. > But the message itself in my opinion must be appeared too. > That's a very good idea. Lets do it this way. > > -- > Alexey U. > > > -- > 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. > > Mateusz -- 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.