[TIP] testing for sysadmins who know bash advice

Benji York benji at benjiyork.com
Mon Jan 14 10:03:15 PST 2008

Graham Carlyle wrote:
> On Tue, 2008-01-08 at 11:29 -0800, Grig Gheorghiu wrote:
>> I don't think I'd use doctest though. A lot of sysadmin scripts touch
>> the file system, so doctest will have problems because you can't expect
>> a certain precise output. I'd use either nose or py.test.
> I don't see why doctest will have problems any more than a "xUnit" style
> test. You still need to create a reproducible context or fixture for the
> tests, which you can do in doctest. I find the Layer feature in the
> zope.testing test runner useful for this.
> http://pypi.python.org/pypi/zope.testing/3.5.1#layers

This reminds me that I remember seeing chroot being used to good effect 
in test (or layer, can't recall) setup and teardown to create a sandbox 
for doing tests that make file system changes.
Benji York

More information about the testing-in-python mailing list