I agree entirely, as it happens! I'm not a big fan of using exec() like this in general. The motivation behind this wasn't so much to save typing (though DRY was a minor motivation) as to minimise the subsequent patch size for the patch that adds actual Unix domain socket support.

In my previous pull request, I explicitly had subclasses for the that combined the tests with the mixins for the different socket types. If you'd like, I can switch the code back to having explicit declarations of the classes mixing the tests and socket mixins together.

The traceback issue isn't such a big problem here because the class definitions themselves are empty, thus the tracebacks end up referencing code in the parent classes rather than the generated classes. The real problem is that somebody searching for a generated classes name is going to hit a brick wall. I do recognise the traceback issue though: I've hit it in the past myself.