Thanks everyone who gave me ideas. It still apparently fails in a debug batch, but I found various instances of PYZOR_CHECK 1.39 and similar in the mail log. So is mysteriously working fine, except when I run a test. Very odd, but I guess I won't complain.