MCPcopy Index your code
hub / github.com/mongodb/mongo-python-driver / check_module

Method check_module

test/test_default_exports.py:42–59  ·  view source on GitHub ↗
(self, mod, ignores)

Source from the content-addressed store, hash-verified

40
41class TestDefaultExports(unittest.TestCase):
42 def check_module(self, mod, ignores):
43 names = dir(mod)
44 names.remove("__all__")
45 for name in mod.__all__:
46 if name not in names and name not in ignores:
47 self.fail(f"{name} was included in {mod}.__all__ but is not a valid symbol")
48
49 for name in names:
50 if name not in mod.__all__ and name not in ignores:
51 if name in GLOBAL_INGORE:
52 continue
53 value = getattr(mod, name)
54 if inspect.ismodule(value):
55 continue
56 if getattr(value, "__module__", None) == "typing":
57 continue
58 if not name.startswith("_"):
59 self.fail(f"{name} was not included in {mod}.__all__")
60
61 def test_pymongo(self):
62 self.check_module(pymongo, PYMONGO_IGNORE)

Callers 3

test_pymongoMethod · 0.95
test_gridfsMethod · 0.95
test_bsonMethod · 0.95

Calls 1

removeMethod · 0.45

Tested by

no test coverage detected