Skip to content

Commit 37fad7d

Browse files
authored
bpo-44019: Add test_all_exported_names for operator module (GH-29124)
1 parent d1b2477 commit 37fad7d

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Lib/test/test_operator.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,18 @@ def __iter__(self):
4545

4646

4747
class OperatorTestCase:
48+
def test___all__(self):
49+
operator = self.module
50+
actual_all = set(operator.__all__)
51+
computed_all = set()
52+
for name in vars(operator):
53+
if name.startswith('__'):
54+
continue
55+
value = getattr(operator, name)
56+
if value.__module__ in ('operator', '_operator'):
57+
computed_all.add(name)
58+
self.assertSetEqual(computed_all, actual_all)
59+
4860
def test_lt(self):
4961
operator = self.module
5062
self.assertRaises(TypeError, operator.lt)

0 commit comments

Comments
 (0)