mirror of
https://github.com/python/cpython.git
synced 2025-12-31 04:23:37 +00:00
bpo-44019: Add test_all_exported_names for operator module (GH-29124)
This commit is contained in:
parent
d1b24775b4
commit
37fad7d3b7
1 changed files with 12 additions and 0 deletions
|
|
@ -45,6 +45,18 @@ def __iter__(self):
|
|||
|
||||
|
||||
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…
Add table
Add a link
Reference in a new issue