mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +00:00
Revert "bpo-38659: [Enum] add _simple_enum decorator (GH-25285)" (GH-25476)
This reverts commit dbac8f40e8
.
This commit is contained in:
parent
dbac8f40e8
commit
503cdc7c12
20 changed files with 34 additions and 871 deletions
|
@ -1941,41 +1941,6 @@ class GeneralModuleTests(unittest.TestCase):
|
|||
fileno=afile.fileno())
|
||||
self.assertEqual(cm.exception.errno, errno.ENOTSOCK)
|
||||
|
||||
def test_addressfamily_enum(self):
|
||||
import _socket, enum
|
||||
CheckedAddressFamily = enum._old_convert_(
|
||||
enum.IntEnum, 'AddressFamily', 'socket',
|
||||
lambda C: C.isupper() and C.startswith('AF_'),
|
||||
source=_socket,
|
||||
)
|
||||
enum._test_simple_enum(CheckedAddressFamily, socket.AddressFamily)
|
||||
|
||||
def test_socketkind_enum(self):
|
||||
import _socket, enum
|
||||
CheckedSocketKind = enum._old_convert_(
|
||||
enum.IntEnum, 'SocketKind', 'socket',
|
||||
lambda C: C.isupper() and C.startswith('SOCK_'),
|
||||
source=_socket,
|
||||
)
|
||||
enum._test_simple_enum(CheckedSocketKind, socket.SocketKind)
|
||||
|
||||
def test_msgflag_enum(self):
|
||||
import _socket, enum
|
||||
CheckedMsgFlag = enum._old_convert_(
|
||||
enum.IntFlag, 'MsgFlag', 'socket',
|
||||
lambda C: C.isupper() and C.startswith('MSG_'),
|
||||
source=_socket,
|
||||
)
|
||||
enum._test_simple_enum(CheckedMsgFlag, socket.MsgFlag)
|
||||
|
||||
def test_addressinfo_enum(self):
|
||||
import _socket, enum
|
||||
CheckedAddressInfo = enum._old_convert_(
|
||||
enum.IntFlag, 'AddressInfo', 'socket',
|
||||
lambda C: C.isupper() and C.startswith('AI_'),
|
||||
source=_socket)
|
||||
enum._test_simple_enum(CheckedAddressInfo, socket.AddressInfo)
|
||||
|
||||
|
||||
@unittest.skipUnless(HAVE_SOCKET_CAN, 'SocketCan required for this test.')
|
||||
class BasicCANTest(unittest.TestCase):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue