# 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/utils.py
# def simple_attr(
#     name,
#     default=NOTHING,
#     validator=None,
#     repr=True,
#     eq=True,
#     hash=None,
#     init=True,
#     converter=None,
#     kw_only=False,
#     inherited=False,
# ):
#     """
#     Return an attribute with a name and no other bells and whistles.
#     """
#     return Attribute(
#         name=name,
#         default=default,
#         validator=validator,
#         repr=repr,
#         cmp=None,
#         eq=eq,
#         hash=hash,
#         init=init,
#         converter=converter,
#         kw_only=kw_only,
#         inherited=inherited,
#     )


import copy
import functools
import gc
import inspect
import itertools
import sys
import pytest
import attr
from operator import attrgetter
from hypothesis import assume, given
from hypothesis.strategies import booleans, integers, lists, sampled_from, text
from attr import _config
from attr._compat import PY2, PY310, ordered_dict
from attr._make import (
    Attribute,
    Factory,
    _AndValidator,
    _Attributes,
    _ClassBuilder,
    _CountingAttr,
    _determine_attrib_eq_order,
    _determine_attrs_eq_order,
    _determine_whether_to_implement,
    _transform_attrs,
    and_,
    fields,
    fields_dict,
    make_class,
    validate,
)
from attr.exceptions import (
    DefaultAlreadySetError,
    NotAnAttrsClassError,
    PythonTooOldError,
)
from .strategies import (
    gen_attr_names,
    list_of_attrs,
    optional_bool,
    simple_attrs,
    simple_attrs_with_metadata,
    simple_attrs_without_metadata,
    simple_classes,
)
from .utils import simple_attr
        from types import new_class
        from typing import Generic, TypeVar
            with pytest.raises(TypeError):
                a < b

            with pytest.raises(TypeError):
                a > b


class TestDetermineAttrsEqOrder(object):
    def test_default(self):
        """
        If all are set to None, set both eq and order to the passed default.
        """
        assert (42, 42) == _determine_attrs_eq_order(None, None, None, 42)

    @pytest.mark.parametrize("eq", [True, False])
    def test_order_mirrors_eq_by_default(self, eq):
        """
        If order is None, it mirrors eq.
        """
        assert (eq, eq) == _determine_attrs_eq_order(None, eq, None, True)

    def test_order_without_eq(self):
        """
        eq=False, order=True raises a meaningful ValueError.
        """
        with pytest.raises(
            ValueError, match="`order` can only be True if `eq` is True too."
        ):
            _determine_attrs_eq_order(None, False, True, True)


# 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/utils.py
# def simple_attr(
#     name,
#     default=NOTHING,
#     validator=None,
#     repr=True,
#     eq=True,
#     hash=None,
#     init=True,
#     converter=None,
#     kw_only=False,
#     inherited=False,
# ):
#     """
#     Return an attribute with a name and no other bells and whistles.
#     """
#     return Attribute(
#         name=name,
#         default=default,
#         validator=validator,
#         repr=repr,
#         cmp=None,
#         eq=eq,
#         hash=hash,
#         init=init,
#         converter=converter,
#         kw_only=kw_only,
#         inherited=inherited,
#     )


# Path: tests/test_make.py
import copy
import functools
import gc
import inspect
import itertools
import sys
import pytest
import attr
from operator import attrgetter
from hypothesis import assume, given
from hypothesis.strategies import booleans, integers, lists, sampled_from, text
from attr import _config
from attr._compat import PY2, PY310, ordered_dict
from attr._make import (
    Attribute,
    Factory,
    _AndValidator,
    _Attributes,
    _ClassBuilder,
    _CountingAttr,
    _determine_attrib_eq_order,
    _determine_attrs_eq_order,
    _determine_whether_to_implement,
    _transform_attrs,
    and_,
    fields,
    fields_dict,
    make_class,
    validate,
)
from attr.exceptions import (
    DefaultAlreadySetError,
    NotAnAttrsClassError,
    PythonTooOldError,
)
from .strategies import (
    gen_attr_names,
    list_of_attrs,
    optional_bool,
    simple_attrs,
    simple_attrs_with_metadata,
    simple_attrs_without_metadata,
    simple_classes,
)
from .utils import simple_attr
        from types import new_class
        from typing import Generic, TypeVar

            with pytest.raises(TypeError):
                a < b

            with pytest.raises(TypeError):
                a > b


class TestDetermineAttrsEqOrder(object):
    def test_default(self):
        """
        If all are set to None, set both eq and order to the passed default.
        """
        assert (42, 42) == _determine_attrs_eq_order(None, None, None, 42)

    @pytest.mark.parametrize("eq", [True, False])
    def test_order_mirrors_eq_by_default(self, eq):
        """
        If order is None, it mirrors eq.
        """
        assert (eq, eq) == _determine_attrs_eq_order(None, eq, None, True)

    def test_order_without_eq(self):
        """
        eq=False, order=True raises a meaningful ValueError.
        """
        with pytest.raises(
            ValueError, match="`order` can only be True if `eq` is True too."
        ):
            _determine_attrs_eq_order(None, False, True, True)


    @given(cmp=booleans(), eq=optional_bool, order=optional_bool)