Hi folks, I'm having an issue with event listener registration. I figured
out that I need to deregister my listeners after each functional test so
they don't get registered twice in the same thread and execute too many
times. But I was using an anonymous callable to register them, like this:

event.listen(resource_class, 'after_insert', ModelVersioner(resource_class,
'create'))

So I can't unlisten, because I don't store the callable created by the call
to ModelVersioner, so I can't replicate the exact signature of the the call
to listen in my call to remove. I'd prefer not to make and track a whole
bunch of callables, and I wouldn't need to if I could remove listeners
without needing to pass in the exact callable. So I'm hoping there is some
other way to nuke listeners other than passing target, event, callback to
event.remove?

Like say
Perhaps event.remove(target, event, *everything*)
or altering the event registry itself? (this is just for tests, ok if it's
not stable API)

thanks!
iain

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to