On Mon, Jul 7, 2008 at 1:48 PM, Wichert Akkerman <[EMAIL PROTECTED]> wrote:
> Previously Mike Orr wrote:
>>
>> On Mon, Jul 7, 2008 at 1:33 PM, Wichert Akkerman <[EMAIL PROTECTED]> wrote:
>> >> What's wrong with using paste.loadapp to properly set 'g' for every
>> >> test that needs it?  That way your test environment is the closest to
>> >> the production environment -- which is the purpose of having tests in
>> >> the first place.
>> >
>> > Unit tests want as little as possible of the full environment. And you
>> > want to be able to unit test code that uses things like g.
>>
>> Well, unit tests (as opposed to functional tests) should test the
>> target routine as closely as possible, without the interference of
>> something like 'g' which should be tested separately.  After all, a
>> value on 'g' is the same as the value standalone.
>
> You might want to unittest a method that uses g in some way. More
> typically you may want to unit test something that stuffs data in c.

True.  I'm just saying if you can code to avoid 'g' and 'c' in your
lib routines, so much the better.  I have never found a use for 'g',
except in one case to put a structure of static data that's parsed on
app startup (or read from a cache pickle).

-- 
Mike Orr <[EMAIL PROTECTED]>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" 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/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to