It seems that my test files and the signal handler are in different applications. Is this the cause of the problem?
Yes. Each tests.py application is atomic. import your signal registration code or manually pair them somewhere in your test to make sure they are listening:
You can put signal processing and registration code anywhere. However, you need to make sure that the module that it imports early so that the signal is processed before any signals are sent.
(From: Listening to signals, connecting receiver functions .)
source share