Hi Gary,

On Thu, Mar 3, 2011 at 3:54 AM, Gary Poster <[email protected]> wrote:
> 1) Let's say you want to see what SQL is being generated by Storm in
> a test.  Is there a better way to do it other than debugger breaks
> into Storm guts?

There's a builtin debug tracer you can use for cases like this.
Sometimes I take a test like this:

    def test_some_storm_code(self):
        < some setup logic >
        < the Storm-using code I'm curious about >
        < more stuff >

And I use the debug tracer to see what's going on:

    def test_some_storm_code(self):
        < some setup logic >
        from storm.tracer import debug; debug(True)
        try:
            < the Storm-using code I'm curious about >
        finally:
            debug(False)
        < more stuff >

We should probably provide a context manager so that you can use
'with', since it'd involve a touch less typing, but this is handy
nonetheless.

Thanks,
J.

_______________________________________________
Mailing list: https://launchpad.net/~launchpad-dev
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~launchpad-dev
More help   : https://help.launchpad.net/ListHelp

Reply via email to