I'm quite new with testing with turbogears and I have some questions (after
figuring up the test.ini thing). I'll be glad for any help with this:
1. *turning of the scheduler while running nosetests*:
I have a scheduler configured in app_cfp.py: base_config.call_on_startup
= [schedule] #imported before
and in the schedule function (using tgscheduler) : if "shell" in
sys.argv:
return # won't run in paster shell mode only in serve
but when I run nosetests it tries to run the scheduler, which I really
don't want it to do. how do I disable the scheduler call in testing mode?
2. *testing multiple engines in my app.:*
* *although I did setup multiple engines in setup_db it seems to be
(althought) I'm not sure that the tests are trying to use the same
DBsession for all the tests instead the seperate DBSession, DBSession2 I
use. I suspect this because one of the tests gets a non existing table
error, where this the db that the tests should setup (and teardown unlike
the other one)
this in the __init__..py setup for the testing:
def setup_db():
"""Method used to build a database"""
engine = config['pylons.app_globals'].sa_engine
engine2 = config['pylons.app_globals'].sa_engine_second
model.init_model(engine,engine2)
model.metadata.create_all(engine)
def teardown_db():
"""Method used to destroy a database"""
engine = config['pylons.app_globals'].sa_engine
#engine2 = config['pylons.app_globals'].sa_engine_second
model.metadata.drop_all(engine)
3 handling failures that demand session.rollback().
since one of my tests fails with sqlalchemy exception, every other tests
that involves the db after that fails, demanding session.rollback, can I
handle that somewhere in nose configuration, that some cleanup including
session.rollback if needed would happen after every db test?
4.can I get some readable results from nosetests? not a long stout text?
even plain text formatted with all the testnames and results woulb be nice.
even better would be a html runner, something we got used to with js
testing suite.
thanks for the help
using tg 2.0
--
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
Visit this group at http://groups.google.com/group/turbogears?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.