This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vinay.sajip
Recipients brett.cannon, drakeol, vinay.sajip
Date 2011-02-26.23:57:09
SpamBayes Score 1.2371178e-06
Marked as misclassified No
Message-id <1298764630.81.0.800513653472.issue11332@psf.upfronthosting.co.za>
In-reply-to
Content
@Brett: I've no religious/dogmatic objection to mocking, either, so I agree with your comment. I merely observed that it's not generally implemented in the Python test suite (not that I've made an exhaustive study of it, so I'm open to being corrected on this point). Also, I don't see much value in some of the low-level tests in the patch. For example: logging.disable is defined as

def disable(level):
    """
    Disable all logging calls less severe than 'level'.
    """
    root.manager.disable = level

The test for it is:

    def test_disable(self):
        disableBackup = logging.root.manager.disable
        logging.disable(10)
        self.assertEqual(logging.root.manager.disable, 10)
        logging.root.manager.disable = disableBackup

which is really just testing at a low level - that the attribute was set - but not more usefully, at a higher level, the practical effect of the disable call.

I appreciate the value that tests bring, but I'm just being a bit wary of letting the tail wag the dog too much in the interests of higher coverage ;-) So, I suppose my test case preferences tend more towards an acceptance test style rather than a "pure" unit test style.
History
Date User Action Args
2011-02-26 23:57:10vinay.sajipsetrecipients: + vinay.sajip, brett.cannon, drakeol
2011-02-26 23:57:10vinay.sajipsetmessageid: <1298764630.81.0.800513653472.issue11332@psf.upfronthosting.co.za>
2011-02-26 23:57:10vinay.sajiplinkissue11332 messages
2011-02-26 23:57:09vinay.sajipcreate