def test_copy_dict_undefined():
    fields = {
        Required("foo"): int
    }
    copied_fields = copy.deepcopy(fields)

    schema = Schema(copied_fields)

    # This used to raise a `TypeError` because the instance of `Undefined`
    # was a copy, so object comparison would not work correctly.
    try:
        schema({"foo": "bar"})
    except Exception as e:
        assert isinstance(e, MultipleInvalid)
test with a copied dictionary
dataset/ETHPy150Open alecthomas/voluptuous/voluptuous/tests/tests.py/test_copy_dict_undefined