Skip Menu |

This queue is for tickets about the Test-NoWarnings CPAN distribution.

Report information
The Basics
Id: 70490
Status: open
Priority: 0/
Queue: Test-NoWarnings

People
Owner: Nobody in particular
Requestors: michael.reddick [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: using Carp::Always makes Test::NoWarnings report no warnings even if there are warnings
Date: Thu, 25 Aug 2011 16:53:18 -0500
To: bug-Test-NoWarnings [...] rt.cpan.org
From: Michael Reddick <michael.reddick [...] gmail.com>
#!/usr/bin/env perl use strict; use warnings; use Test::More tests => 2; use Test::NoWarnings; use Carp::Always; ok 1; warn 'asdf'; t/tmp.t .. 1..2 ok 1 ok 2 - no warnings asdf at t/tmp.t line 10 ok All tests successful. Files=1, Tests=2, 0 wallclock secs ( 0.03 usr 0.01 sys + 0.04 cusr 0.00 csys = 0.08 CPU) Result: PASS
Subject: Re: [rt.cpan.org #70490] using Carp::Always makes Test::NoWarnings report no warnings even if there are warnings
Date: Thu, 25 Aug 2011 23:32:32 +0100
To: bug-Test-NoWarnings [...] rt.cpan.org
From: Fergal Daly <fergal [...] esatclear.ie>
These 2 modules both want to alter the global warning behaviour. That's always going to lead to trouble. Whichever is loaded last will win. Carp::Always (or anything else which unconditionally alters global behaviour like this) is not something you should "use" in a library because you have no idea if the users of your library want this behaviour. So this clash shouldn't be a problem for testing most modules. It's fair enough to "use" it and modules like it from a script because the script is knows the full state of the world where a library doesn't. Is there some reason to use both while testing?
Subject: Re: [rt.cpan.org #70490] using Carp::Always makes Test::NoWarnings report no warnings even if there are warnings
Date: Thu, 25 Aug 2011 17:44:37 -0500
To: bug-Test-NoWarnings [...] rt.cpan.org
From: Michael Reddick <michael.reddick [...] gmail.com>
Yeah there's no reason to leave Carp::Always in a test file. I was just using it for debugging and noticed it caused that side effect of making Test::NoWarnings stop working so I filed a bug report. It was confusing me at first and it took awhile to figure out that was the reason. Maybe add a note to the PITFALLS section? On Thu, Aug 25, 2011 at 5:32 PM, Fergal Daly via RT <bug-Test-NoWarnings@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=70490 > > > These 2 modules both want to alter the global warning behaviour. > That's always going to lead to trouble. Whichever is loaded last will > win. > > Carp::Always (or anything else which unconditionally alters global > behaviour like this) is not something you should "use" in a library > because you have no idea if the users of your library want this > behaviour. So this clash shouldn't be a problem for testing most > modules. > > It's fair enough to "use" it and modules like it from a script because > the script is knows the full state of the world where a library > doesn't. > > Is there some reason to use both while testing? > >