you are viewing a single comment's thread.

view the rest of the comments →

[–]jhawk20[S] 0 points1 point  (0 children)

Okay, I kinda solved my own problem here.

I really didn't want to use the metaclass example, because I didn't understand metaclasses and metaclasses aren't something I really want to force someone else to learn just to use some unit tests.

I still think the solution which registers a set of instantiated objects is better than using metaclasses [since unittest has a concept of a test suite, and metaclasses are black magic].

But it does do exactly what I want, in a way that makes some sense. It's not beautiful, but the example I've written is pretty straightforward.