Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: I don't care about *your* warnings!

by adrianh (Chancellor)
on Mar 01, 2007 at 14:48 UTC ( #602695=note: print w/ replies, xml ) Need Help??


in reply to I don't care about *your* warnings!

First, I'm curious as to why I'm seeing these warnings

You're seeing them because (under the hood) Test::Class is doing:

eval { Contextual::Return::Value->isa( 'SomeOtherClass' ) }

and Contextual::Return::Value::AUTOLOAD isn't written with autoloading class methods in mind and assuming that its first argument is a reference. I've submitted an RT ticket. I might tweak T::C to avoid this, but I think this is really C:R:V's fault :-)

Is there any way for me to essentially turn warnings off for Contextual::Return, short of making a local copy and commenting it out?
$SIG{ __WARN__ } = sub { return if caller eq 'Contextual::Return::Value'; warn @_; };


Comment on Re: I don't care about *your* warnings!
Select or Download Code
Replies are listed 'Best First'.
Re^2: I don't care about *your* warnings!
by agianni (Hermit) on Mar 01, 2007 at 19:49 UTC

    Actually, I talked with Damian, and he put together a patch for Contextual::Return that seems to take care of it as well. Before that patch, and with an earlier version of T::C (before you wrapped the isa call with the eval) it used to create a fatal error when Contextual::Return was loaded.

    BTW, Test::Class has made my testing soooo much easier and the improvements over the past several months have made it that much more useful. I highly recommend it for testing, especially for large modules and applications.

      BTW, Test::Class has made my testing soooo much easier and the improvements over the past several months have made it that much more useful. I highly recommend it for testing, especially for large modules and applications.

      Flattery gets you everywhere :-)

Re^2: I don't care about *your* warnings!
by adrianh (Chancellor) on Mar 01, 2007 at 16:53 UTC
    I might tweak T::C to avoid this
    0.24 on its way to CPAN now avoids these warnings, and has a bug fix to boot :-)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://602695]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (18)
As of 2015-07-31 21:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (282 votes), past polls