Questions after testtools merge
Martin (gzlist)
gzlist at googlemail.com
Mon Dec 28 23:24:27 GMT 2009
On 28/12/2009, Robert Collins <robertc at robertcollins.net> wrote:
>
> That code is replaced by discarding tests that have been run, a much
> simpler way of freeing memory.
Great, hoped something like that was the case, the old way was ugly.
>> TestCase.setKeepLogfile is gone (though it is still used in
>> TestCase._cleanupLogFile and mentioned in the TestCase._finishLogFile
>> docstring), and there seems to be no way of keeping the file around.
>> TestCase._get_log was ugly before and is worse now. I have
>> monkey-patched keeping the log file back in for the moment.
>
> Huh? I don't quite follow - I'll look at this next week. You shouldn't
> be using _get_log anywhere now.
I was using setKeepLogfile, in order to reinstate it I had to fiddle
with _get_log whereas I wasn't before.
Could stop using setKeepLogfile instead but:
1) Would mean I need to write out to disk what was there already.
2) The encoding handling for logs is worse than the code I use currently.
>> With testtools it seems that naffy _StringException instances are
>> given to TestResult methods rather than the actual exception. How can
>> this be avoided? Getting the traceback is a pain, as
>> testtools.content.TracebackContent is just bogus - it will throw on
>> non-ascii.
>
> More details please, I spent some time testing this and getting it
> solid. the content objects are MIME objects - they can encode arbitrary
> data; if there is a bug in testtools, please file it!
It's a pain to track down as there are so many levels of indirection,
but I'm working on it. The MIME thing is just a bad model, tracebacks
and logs are bytes which do not conform to the envelope the code is
trying to squish them into.
> How do you mean? its not global....
Hm, ignore that, seems it's actually always been thus.
> Please file separate bugs for each issue with backtraces or simple test
> cases, so that I can fix them.
Well, I'm struggling a little at the moment as selftest has started
crashing python in a semi-reproducible manner. With `bzr selftest -s
bb.` it goes through most of the tests then dies with 'The instruction
at "..." referenced memory at "...". The memory could not be
"written".' after printing the line:
[1144/1167 in 3m48s, 1 failed] blackbox.test_version_info.TestVersionInfo.test_
Seeing if I can reproduce with a smaller subset currently, and not
having any luck so far. I have confirmed it's a r4920 regression
however.
Martin
More information about the bazaar
mailing list