def _test__cmp__(self, __cmp__, expected, oper):
        cases = (
            (ctds.Parameter(b'1234'), ctds.Parameter(b'123')),
            (ctds.Parameter(b'123'), ctds.Parameter(b'123')),
            (ctds.Parameter(b'123'), ctds.Parameter(b'123', output=True)),
            (ctds.Parameter(b'123'), ctds.Parameter(b'1234')),
            (ctds.Parameter(b'123'), b'123'),
            (ctds.Parameter(b'123'), ctds.Parameter(123)),
            (ctds.Parameter(b'123'), unicode_('123')),
            (ctds.Parameter(b'123'), ctds.SqlBinary(None)),
            (ctds.Parameter(b'123'), 123),
            (ctds.Parameter(b'123'), None),
        )

        for index, args in enumerate(cases):
            operation = '[{0}]: {1} {2} {3}'.format(index, repr(args[0]), oper, repr(args[1]))
            if expected[index] == TypeError:
                try:
                    __cmp__(*args)
                except TypeError as ex:
                    regex = (
                        r"'{0}' not supported between instances of '[^']+' and '[^']+'".format(oper)
                        if not PY3 or PY36
                        else
                        r'unorderable types: \S+ {0} \S+'.format(oper)
                    )
                    self.assertTrue(re.match(regex, str(ex)), ex)
                else:
                    self.fail('{0} did not fail as expected'.format(operation)) # pragma: nocover
            else:
                self.assertEqual(__cmp__(*args), expected[index], operation)