def test_deprecated(caplog):
    'Test deprecation log.'
    schema = vol.Schema({'venus': cv.boolean, 'mars': cv.boolean})
    deprecated_schema = vol.All(cv.deprecated('mars'), schema)
    deprecated_schema({'venus': True})
    assert (len(caplog.records) == 0)
    deprecated_schema({'mars': True})
    assert (len(caplog.records) == 1)
    assert (caplog.records[0].name == __name__)
    assert ("The 'mars' option (with value 'True') is deprecated, please remove it from your configuration." in caplog.text)
Test deprecation log.
def test_deprecated(caplog):
    
    schema = vol.Schema({'venus': cv.boolean, 'mars': cv.boolean})
    deprecated_schema = vol.All(cv.deprecated('mars'), schema)
    deprecated_schema({'venus': True})
    assert (len(caplog.records) == 0)
    deprecated_schema({'mars': True})
    assert (len(caplog.records) == 1)
    assert (caplog.records[0].name == __name__)
    assert ("The 'mars' option (with value 'True') is deprecated, please remove it from your configuration." in caplog.text)