Python Mixins
rantingrick
rantingrick at gmail.com
Sat Sep 24 18:41:22 EDT 2011
On Sep 24, 3:57 am, Steven D'Aprano <steve
+comp.lang.pyt... at pearwood.info> wrote:
> class StandardTestMixin:
> def test_requires_one_argument(self):
> self.assertRaises(TypeError, self.func)
> def test_has_docstring(self):
> self.assertTrue(self.func.__doc__)
And this is another example of why we need doc-string reforms. Here we
have a well know "pythonista" (for lack of better word) who needs to
write a test for doc-string inclusion because he refuses to get in the
habit of writing them. People, EVERY method and function MUST have a
doc-string! What is the purpose of having doc-strings if we are too
lazy to use them!
More information about the Python-list
mailing list