Best practice for unit tests that rely on internet access?

David Cantrell david at
Wed May 4 13:10:52 BST 2011

On Wed, May 04, 2011 at 12:51:01PM +0100, Peter Edwards wrote:

> Often you can put the connectivity tests in the developer tests in the xt/
> directory and then they don't need to be run at install time.

But then they only get run whenever the developer is paying attention to
the module, which is bad from the point of view of finding out quickly
when it breaks because of changes on the third party site you're

Net::Random has both faked up tests that mock a data source, and tests
that hit a live data source if they can, but skip if there's any
errors.  I should fix that so that they only skip if there are any
*expected* errors - ie, errors that I already know might happen.

David Cantrell | A machine for turning tea into grumpiness

Compromise: n: lowering my standards so you can meet them

More information about the mailing list