[Scipy-tickets] [SciPy] #1215: ERROR: test_none (test_signaltools.TestMedFilt)

SciPy Trac scipy-tickets@scipy....
Fri Jul 2 23:19:54 CDT 2010


#1215: ERROR: test_none (test_signaltools.TestMedFilt)
---------------------------+------------------------------------------------
  Reporter:  vincentdavis  |       Owner:  somebody
      Type:  defect        |      Status:  closed  
  Priority:  normal        |   Milestone:  0.8.0   
 Component:  Other         |     Version:  0.7.0   
Resolution:  fixed         |    Keywords:          
---------------------------+------------------------------------------------
Changes (by rgommers):

  * status:  needs_review => closed
  * resolution:  => fixed


Old description:

> On Tue, Jun 29, 2010 at 3:30 AM, Vincent Davis <vincent@vincentdavis.net>
> wrote:
> On Mon, Jun 28, 2010 at 10:02 AM, Ralf Gommers
>
> It would seem to me that the set should fail.
> def test_none(self):
>        """Ticket #1124."""
>        signal.medfilt(None)
>
> Not sure how to do this but I guess it is possible that the error is
> not a sigfualt or medfilt could return a more meaningful error because
> None is not a good argument. Volume=None > gets converted with
> numpy.atleast_1d(*arys) which returns array([None], dtype=object).
>
> So should the test use an expect exception? Or whats the fix?
>
> I don't get an exception on 32-bit OS X. Looking at the test, the only
> purpose seems to be to ensure there's no segfault. There are probably
> loads of functions that do strange things when you feed them object
> arrays with None or something more random inside - no point checking for
> that in the function. So to fix the test, maybe simply:
>
> def test_none(self):
>     """Ticket #1124. Ensure this does not segfault."""
>     try:
>         signal.medfilt(None)
>     except:
>         pass
>
> Cheers,
> Ralf

New description:

 <from mailing list>

 '''Vincent''':

 It would seem to me that the set should fail.
 {{{
 def test_none(self):
        """Ticket #1124."""
        signal.medfilt(None)
 }}}

 Not sure how to do this but I guess it is possible that the error is not a
 sigfualt or medfilt could return a more meaningful error because None is
 not a good argument. Volume=None > gets converted with
 ``numpy.atleast_1d(*arys)`` which returns ``array([None], dtype=object)``.

 So should the test use an expect exception? Or whats the fix?

 '''Ralf''':

 I don't get an exception on 32-bit OS X. Looking at the test, the only
 purpose seems to be to ensure there's no segfault. There are probably
 loads of functions that do strange things when you feed them object arrays
 with None or something more random inside - no point checking for that in
 the function. So to fix the test, maybe simply:

 {{{
 def test_none(self):
     """Ticket #1124. Ensure this does not segfault."""
     try:
         signal.medfilt(None)
     except:
         pass
 }}}

--

Comment:

 Fixed in r6580 and r6581.

-- 
Ticket URL: <http://projects.scipy.org/scipy/ticket/1215#comment:2>
SciPy <http://www.scipy.org>
SciPy is open-source software for mathematics, science, and engineering.


More information about the Scipy-tickets mailing list