# Path: tests/strategies.py
# def gen_attr_names():
# def maybe_underscore_prefix(source):
# def _create_hyp_nested_strategy(draw, simple_class_strategy):
# def simple_attrs_with_metadata(draw):
# def simple_classes(
#     draw, slots=None, frozen=None, weakref_slot=None, private_attrs=None
# ):
#         def pre_init(self):
#         def post_init(self):
#         def init(self, *args, **kwargs):


from collections import OrderedDict
from hypothesis import assume, given
from hypothesis import strategies as st
from attr import asdict, assoc, astuple, evolve, fields, has
from attr._compat import TYPE, Mapping, Sequence, ordered_dict
from attr.exceptions import AttrsAttributeNotFoundError
from attr.validators import instance_of
from .strategies import nested_classes, simple_classes
import pytest
import attr
    import attr
            "x": 1,
            "y": container([{"x": 2, "y": 3}, {"x": 4, "y": 5}, "a"]),
        } == asdict(
            C(1, container([C(2, 3), C(4, 5), "a"])),
            retain_collection_types=True,
        )

    @given(set_type=st.sampled_from((set, frozenset)))
    def test_sets_no_retain(self, C, set_type):
        """
        Set types are converted to lists if retain_collection_types=False.
        """
        d = asdict(
            C(1, set_type((1, 2, 3))),
            retain_collection_types=False,
            recurse=True,
        )

        assert {"x": 1, "y": [1, 2, 3]} == d

    @given(st.sampled_from(MAPPING_TYPES))
    def test_dicts(self, C, dict_factory):
        """
        If recurse is True, also recurse into dicts.
        """
        res = asdict(C(1, {"a": C(4, 5)}), dict_factory=dict_factory)

        assert {"x": 1, "y": {"a": {"x": 4, "y": 5}}} == res
        assert isinstance(res, dict_factory)


# Path: tests/strategies.py
# def gen_attr_names():
# def maybe_underscore_prefix(source):
# def _create_hyp_nested_strategy(draw, simple_class_strategy):
# def simple_attrs_with_metadata(draw):
# def simple_classes(
#     draw, slots=None, frozen=None, weakref_slot=None, private_attrs=None
# ):
#         def pre_init(self):
#         def post_init(self):
#         def init(self, *args, **kwargs):


# Path: tests/test_funcs.py
from collections import OrderedDict
from hypothesis import assume, given
from hypothesis import strategies as st
from attr import asdict, assoc, astuple, evolve, fields, has
from attr._compat import TYPE, Mapping, Sequence, ordered_dict
from attr.exceptions import AttrsAttributeNotFoundError
from attr.validators import instance_of
from .strategies import nested_classes, simple_classes
import pytest
import attr
    import attr

            "x": 1,
            "y": container([{"x": 2, "y": 3}, {"x": 4, "y": 5}, "a"]),
        } == asdict(
            C(1, container([C(2, 3), C(4, 5), "a"])),
            retain_collection_types=True,
        )

    @given(set_type=st.sampled_from((set, frozenset)))
    def test_sets_no_retain(self, C, set_type):
        """
        Set types are converted to lists if retain_collection_types=False.
        """
        d = asdict(
            C(1, set_type((1, 2, 3))),
            retain_collection_types=False,
            recurse=True,
        )

        assert {"x": 1, "y": [1, 2, 3]} == d

    @given(st.sampled_from(MAPPING_TYPES))
    def test_dicts(self, C, dict_factory):
        """
        If recurse is True, also recurse into dicts.
        """
        res = asdict(C(1, {"a": C(4, 5)}), dict_factory=dict_factory)

        assert {"x": 1, "y": {"a": {"x": 4, "y": 5}}} == res
        assert isinstance(res, dict_factory)


    @given(simple_classes(private_attrs=False), st.sampled_from(MAPPING_TYPES))