Re: tests fail because of g

2008-07-08 Thread Mike Orr
On Mon, Jul 7, 2008 at 3:58 PM, Mike Orr [EMAIL PROTECTED] wrote: On Mon, Jul 7, 2008 at 3:29 PM, Wichert Akkerman [EMAIL PROTECTED] wrote: Putting database lookup values into 'g' was an idea I had not thought of. When I've come across that situation, I put a function in the model that

Re: tests fail because of g

2008-07-07 Thread Alberto Valverde
Jonathan Vanasco wrote: I have several helper classes that use g from pylons You have a design problem then :) pylons.g is really a substitute for module-level singletons so you can have them associated to an app's instance and have several of these coexisting in the same process without

Re: tests fail because of g

2008-07-07 Thread Jonathan Vanasco
hm... in this instance, i use g for three things: 1- on startup, i pull constants out of the DB and stash them into g 2- misc form classes refer to g as the values to use for validation 3- templates use them to generate dropdowns i guess i could use some sort of factory function to pull g on

Re: tests fail because of g

2008-07-07 Thread Mike Orr
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

Re: tests fail because of g

2008-07-07 Thread Wichert Akkerman
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

Re: tests fail because of g

2008-07-07 Thread Mike Orr
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

Re: tests fail because of g

2008-07-07 Thread Mike Orr
On Mon, Jul 7, 2008 at 2:10 PM, Jonathan Vanasco [EMAIL PROTECTED] wrote: On Jul 7, 4:53 pm, Mike Orr [EMAIL PROTECTED] wrote: 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

tests fail because of g

2008-07-05 Thread Jonathan Vanasco
I have several helper classes that use g from pylons I get tons of errors when trying to run tests ( via python setup.py nosetests ) as importing those packages causes this: TypeError: No object (name: G) has been registered for this thread