Skip to content

Commit 06f64c4

Browse files
committed
Add test that __module__ is accurate
1 parent 5dc03cb commit 06f64c4

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

pandas/tests/api/test_api.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -566,3 +566,13 @@ def test_attributes_module(module_name):
566566
)
567567
]
568568
assert len(failures) == 0, "\n".join(str(e) for e in failures)
569+
570+
# Check that all objects can indeed be imported from their __module__
571+
failures = []
572+
for module_name, name, obj in objs:
573+
module = importlib.import_module(obj.__module__)
574+
try:
575+
getattr(module, name)
576+
except Exception:
577+
failures.append((module_name, name, type(obj), obj.__module__))
578+
assert len(failures) == 0, "\n".join(str(e) for e in failures)

0 commit comments

Comments
 (0)