On Wed, 15 Jul 2009 11:42:15 -0700
Christopher Lee <[email protected]> wrote:

> our test suite seems to be more verbose than ever as a result of the  
> latest changes. Could you please apply the logger.disable() method
> to hide *expected messages* during the tests?
If by the above you meant I should explicitly call logger.disable() in
test code, I do not think this is a good idea - doing this would pretty
much circumvent the 'verbosity' flag of runtest, making it impossible
(without editing code) to obtain verbose output even when desired. Not
to mention that unless whoever writes a certain test is very careful
and restores the original verbosity level upon teardown, any changes
made here by one tests could (I haven't tested this so I may be wrong)
affect other tests executed in the same run.

Alternatively, we could control this via the aforementioned 'verbosity'
flag of runtest. In general, this should be simple enough to do - right
now setting this flag to 0 or 1 quells all debug-level messages so it
would be natural to extend this further, having level 0 quell both
debug and info messages. The following commit in the 'silencio' branch

http://github.com/mkszuba/pygr/commit/ec35aed89e239ec852b82fa926664a30f8b9b6c8

does just that. Et voila, cnestedlist code is quiet again!

HOWEVER, in practice this approach doesn't quite work yet - info
messages from tests may be quelled but so do those from runtest itself!
This is a bit of a problem because one of the messages which disappear
at verbosity=0 is the one we are usually the most interested in, i.e.
the final "X passed, X failed, X skipped" one. The 'running tests for
module abc' messages are gone too, which is not a problem in itself
(the old framework didn't display anything like that, after all) but
looks kind of funny if you note each module's final 'xxx tests run'
is still printed.

One way of bypassing this would be to have runtest enable and disable
levels before and after running each test module, along the lines of:

        logger.disable(user_specified_level)    # Based on the 'verbosity' flag
        results = runner.run(suite)
        logger.disable(0)

This could be implemented very quickly but is, in my opinion, rather
inelegant.

Alternatively, we could add a new priority level to the logger above
'info' (but probably below 'warning'); 'notice' springs to mind as a
name for such a level, in accordance with syslog levels (although were
this syslog, we would likely use a different facility instead of a
different level). I've had a look at documentation and it seems
implementing a new level is far from difficult, so it is a viable
option.

What do you guys think?

-- 
MS

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pygr-dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/pygr-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to