# 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):


import inspect
import pickle
import pytest
import six
import attr
from copy import deepcopy
from hypothesis import assume, given
from hypothesis.strategies import booleans
from attr._compat import PY2, PY36, TYPE
from attr._make import NOTHING, Attribute
from attr.exceptions import FrozenInstanceError
from .strategies import optional_bool
    @pytest.mark.parametrize("slots", [True, False])
    @pytest.mark.parametrize("frozen", [True, False])
    def test_eq_only(self, slots, frozen):
        """
        Classes with order=False cannot be ordered.

        Python 3 throws a TypeError, in Python2 we have to check for the
        absence.
        """

        @attr.s(eq=True, order=False, slots=slots, frozen=frozen)
        class C(object):
            x = attr.ib()

        if not PY2:
            possible_errors = (
                "unorderable types: C() < C()",
                "'<' not supported between instances of 'C' and 'C'",
                "unorderable types: C < C",  # old PyPy 3
            )

            with pytest.raises(TypeError) as ei:
                C(5) < C(6)

            assert ei.value.args[0] in possible_errors
        else:
            i = C(42)
            for m in ("lt", "le", "gt", "ge"):
                assert None is getattr(i, "__%s__" % (m,), None)


# 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_functional.py
import inspect
import pickle
import pytest
import six
import attr
from copy import deepcopy
from hypothesis import assume, given
from hypothesis.strategies import booleans
from attr._compat import PY2, PY36, TYPE
from attr._make import NOTHING, Attribute
from attr.exceptions import FrozenInstanceError
from .strategies import optional_bool

    @pytest.mark.parametrize("slots", [True, False])
    @pytest.mark.parametrize("frozen", [True, False])
    def test_eq_only(self, slots, frozen):
        """
        Classes with order=False cannot be ordered.

        Python 3 throws a TypeError, in Python2 we have to check for the
        absence.
        """

        @attr.s(eq=True, order=False, slots=slots, frozen=frozen)
        class C(object):
            x = attr.ib()

        if not PY2:
            possible_errors = (
                "unorderable types: C() < C()",
                "'<' not supported between instances of 'C' and 'C'",
                "unorderable types: C < C",  # old PyPy 3
            )

            with pytest.raises(TypeError) as ei:
                C(5) < C(6)

            assert ei.value.args[0] in possible_errors
        else:
            i = C(42)
            for m in ("lt", "le", "gt", "ge"):
                assert None is getattr(i, "__%s__" % (m,), None)


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