From 37fad7d3b7154c44b9902a2ab0db8641f1a0284b Mon Sep 17 00:00:00 2001 From: Dong-hee Na Date: Fri, 22 Oct 2021 07:58:04 +0900 Subject: bpo-44019: Add test_all_exported_names for operator module (GH-29124) --- Lib/test/test_operator.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Lib/test/test_operator.py b/Lib/test/test_operator.py index cf3439f..b7e38c2 100644 --- a/Lib/test/test_operator.py +++ b/Lib/test/test_operator.py @@ -45,6 +45,18 @@ class BadIterable: class OperatorTestCase: + def test___all__(self): + operator = self.module + actual_all = set(operator.__all__) + computed_all = set() + for name in vars(operator): + if name.startswith('__'): + continue + value = getattr(operator, name) + if value.__module__ in ('operator', '_operator'): + computed_all.add(name) + self.assertSetEqual(computed_all, actual_all) + def test_lt(self): operator = self.module self.assertRaises(TypeError, operator.lt) -- cgit v0.12