assertRaises not detecting exceptions in __getattr__

A friend of mine asked for my help to find the cause of a bug he was seeing in a complex Python class he was writing. The class was supposed to raise an exception when a certain method was called but the unit tests were not picking up that exception. I have to confess I was a little stumped at first but simplifying his code to the bare minimum made the problem more evident. »