in reply to Should Test::Most import strict and warnings?

I'd say no. Why would Test::More turn on strict and warnings in the calling scope? Many people consider having a non-empty @EXPORT (and hence, a default export if no argument to use Module are given) to be rude - why would by default turning on strict/warnings in the calling scope be any different? It's also invisible, unexpected magic. I don't like invisible, unexpected magic. People aren't used that strict or warnings is on if there isn't a visible use strict, use warning. Invisible magic is hard to debug if you don't know about it. And why Test::More? Why not My::Funky::Module?
  • Comment on Re: Should Test::Most import strict and warnings?

Replies are listed 'Best First'.
Re^2: Should Test::Most import strict and warnings?
by Ovid (Cardinal) on Feb 05, 2010 at 12:45 UTC
      Test::Most, not Test::More. That's a very important difference here.
      Sorry, I'm just used to typing Test::More.

      But that doesn't change my arguments. I wouldn't want any module to turn on a pragma in the calling scope - unless that is its specific purpose. turn::on::all::pragmata should turn it on. But not something from the Test::* namespace.

        I'd say that reducing boilerplate code is one of the main advantages of Test::Most, so I think it will be logically if it will enable strict and warnings. The people who don't love surprises and magic can always replace it with:

        use strict; use warnings; use Test::More; use Test::Exception; use Test::Differences; use Test::Deep; use Test::Warn;