@@ -0,0 +1,1395 @@
+import pytest%0A%0Afrom attr._compat import metadata_proxy%0A%0A%0A@pytest.fixture(name=%22mp%22)%0Adef _mp():%0A    return metadata_proxy(%7B%22x%22: 42, %22y%22: %22foo%22%7D)%0A%0A%0Aclass TestMetadataProxy:%0A    %22%22%22%0A    Ensure properties of metadata_proxy independently of hypothesis strategies.%0A    %22%22%22%0A%0A    def test_repr(self, mp):%0A        %22%22%22%0A        repr makes sense and is consistent across Python versions.%0A        %22%22%22%0A        assert any(%0A            %5B%0A                %22mappingproxy(%7B'x': 42, 'y': 'foo'%7D)%22 == repr(mp),%0A                %22mappingproxy(%7B'y': 'foo', 'x': 42%7D)%22 == repr(mp),%0A            %5D%0A        )%0A%0A    def test_immutable(self, mp):%0A        %22%22%22%0A        All mutating methods raise errors.%0A        %22%22%22%0A        with pytest.raises(TypeError, match=%22not support item assignment%22):%0A            mp%5B%22z%22%5D = 23%0A%0A        with pytest.raises(TypeError, match=%22not support item deletion%22):%0A            del mp%5B%22x%22%5D%0A%0A        with pytest.raises(AttributeError, match=%22no attribute 'update'%22):%0A            mp.update(%7B%7D)%0A%0A        with pytest.raises(AttributeError, match=%22no attribute 'clear'%22):%0A            mp.clear()%0A%0A        with pytest.raises(AttributeError, match=%22no attribute 'pop'%22):%0A            mp.pop(%22x%22)%0A%0A        with pytest.raises(AttributeError, match=%22no attribute 'popitem'%22):%0A            mp.popitem(%22x%22)%0A%0A        with pytest.raises(AttributeError, match=%22no attribute 'setdefault'%22):%0A            mp.setdefault(%22x%22)%0A

Test metadata_proxy properties independently from hypothesis strategies