diff options
| author | Dong-hee Na <donghee.na@python.org> | 2021-10-21 22:58:04 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-10-21 22:58:04 (GMT) |
| commit | 37fad7d3b7154c44b9902a2ab0db8641f1a0284b (patch) | |
| tree | 12e1886bea5bbf2177f95537cecb6b00f72e21a7 /Lib/test/test_operator.py | |
| parent | d1b24775b462f4f28aa4929fd031899170793388 (diff) | |
| download | cpython-37fad7d3b7154c44b9902a2ab0db8641f1a0284b.zip cpython-37fad7d3b7154c44b9902a2ab0db8641f1a0284b.tar.gz cpython-37fad7d3b7154c44b9902a2ab0db8641f1a0284b.tar.bz2 | |
bpo-44019: Add test_all_exported_names for operator module (GH-29124)
Diffstat (limited to 'Lib/test/test_operator.py')
| -rw-r--r-- | Lib/test/test_operator.py | 12 |
1 files changed, 12 insertions, 0 deletions
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) |
