mirror of
https://github.com/python/cpython.git
synced 2024-11-24 10:24:35 +08:00
bpo-44019: Add test_all_exported_names for operator module (GH-29124)
This commit is contained in:
parent
d1b24775b4
commit
37fad7d3b7
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user