I see two potential reasons why with the code you provide, your function isn't being called, but no error is occurring either:
1 - self.extraction
does not have the right signature. If the supplied function isn't one that takes exactly one argument, it won't be called. In the case of a instance function (method), this does not include self
. So your method's signature should look like this:
def extraction(self, token):
...
I ran into this case myself a few weeks ago and it cost me a few hours. It's strange that the framework does not complain about the function's signature, and yet doesn't call it either.
2 - tokens
is an empty iterable. Since the function will be called once for each item in the iterable, if it is empty, it will never be called. If tokens
isn't an iterable at all, it seems that you get an error stating this.