I'm writing some descriptors to encapsulate data validation and want to write tests for them.
I'm wondering if I should test them by creating instances of the descriptors in my tests and then calling the __get__
or __set__
methods explicitly.
Or should I create a special class in my test file which uses the descriptor class and then use that class in my tests?
Or should I add the descriptor to my subclass of unittest.TestCase
?