From ea4fe80faf745ad16e83a5e313f263dc412b4304 Mon Sep 17 00:00:00 2001 From: mengyujackson121 Date: Sat, 12 Oct 2019 20:34:36 -0400 Subject: [PATCH] Test all constants reexported --- trio/tests/test_socket.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/trio/tests/test_socket.py b/trio/tests/test_socket.py index c03c8bb8ff..ab7c145934 100644 --- a/trio/tests/test_socket.py +++ b/trio/tests/test_socket.py @@ -93,6 +93,15 @@ def test_socket_has_some_reexports(): assert tsocket.ntohs == stdlib_socket.ntohs +def test_all_constants_reexported(): + trio_tsocket_exports = set(dir(tsocket)) + + for name in dir(stdlib_socket): + if name.isupper() and name[0] != "_": + stdlib_constant = name + assert stdlib_constant in trio_tsocket_exports + + ################################################################ # name resolution ################################################################