python/test: Move the test description logic to the base class.