def assert_keys_are_subset(dict1, dict2):
    """
    Example:
        >>> # DISABLE_DOCTEST
        >>> dict1 = {1:1, 2:2, 3:3}
        >>> dict2 = {2:3, 3:3}
        >>> assert_keys_are_subset(dict1, dict2)
        >>> #dict2 = {4:3, 3:3}
    """
    keys1 = set(dict1.keys())
    keys2 = set(dict2.keys())
    unknown_keys = keys2.difference(keys1)
    assert len(unknown_keys) == 0, 'unknown_keys=%r' % (unknown_keys,)
def assert_keys_are_subset ( dict1 , dict2 ) : keys1 = set ( dict1 . keys ( ) ) keys2 = set ( dict2 . keys ( ) ) unknown_keys = keys2 . difference ( keys1 ) assert len ( unknown_keys ) == 0 , 'unknown_keys=%r' % ( unknown_keys , )
Example:
        >>> # DISABLE_DOCTEST
        >>> dict1 = {1:1, 2:2, 3:3}
        >>> dict2 = {2:3, 3:3}
        >>> assert_keys_are_subset(dict1, dict2)
        >>> #dict2 = {4:3, 3:3}