mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-11-17 13:23:46 +08:00
Make pymeshlab imports lazy in exporter utilities
This commit is contained in:
1 parent
50e0e3c70c
commit
96be9b22b8
3 files changed
+27
-3
No files matched your search
@@ -0,0 +1,21 @@
|
||||
"""Tests for exporter dependency imports."""
|
||||
|
||||
import importlib
|
||||
import sys
|
||||
|
||||
|
||||
def test_exporter_modules_do_not_eagerly_import_pymeshlab(monkeypatch):
|
||||
"""Exporter modules should import without initializing pymeshlab."""
|
||||
monkeypatch.setitem(sys.modules, "pymeshlab", None)
|
||||
|
||||
modules = [
|
||||
"nerfstudio.exporter.exporter_utils",
|
||||
"nerfstudio.exporter.tsdf_utils",
|
||||
]
|
||||
for module in modules:
|
||||
sys.modules.pop(module, None)
|
||||
|
||||
for module in modules:
|
||||
importlib.import_module(module)
|
||||
|
||||
assert sys.modules["pymeshlab"] is None
|
||||
Reference in new issue
Block a user