'Test assertWarns works when creating a class instance.'

def test_assertWarnsOnClass(self):

    class Warn:
        def __init__(self):
            warnings.warn('Do    not    call    me', category=RuntimeWarning)
    r = self.assertWarns(RuntimeWarning, 'Do    not    call    me', __file__, Warn)
    self.assertTrue(isinstance(r, Warn))
    r = self.assertWarns(RuntimeWarning, 'Do    not    call    me', __file__, Warn)
    self.assertTrue(isinstance(r, Warn))
