After checking numerous times, I did find inconsistent info about the topic.
In some case, I did find that __init__ and __del__
are the python equivalent of constructors and destructors. This seems to be true for __init__
, since I see it called when the class is created; but __del__
is never called, when the program end.
In other cases, I did find that __del__
is bad, and you have to explicitly deallocate everything by hand.
Now, the issue is: which is which? Because using a unittest.TestCase class, when I call __del__
it never get called. Sadly I can't use tear down because I need to start a process before the tests run, and end it once I am done with the tests