Catch TypeError exception in tearDownClass method