Open3d: Reinstate re-use of stand-alone test method (#45755)

* open3d: Reinstate re-use of stand-alone test method
* open3d: ignore test_open3d_import when ~python

---------

Co-authored-by: Tamara Dahlgren <35777542+tldahlgren@users.noreply.github.com>
This commit is contained in:
AcriusWinter 2024-08-15 13:52:31 -07:00 committed by GitHub
parent 904d43f0e6
commit a965c7c5c8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -120,11 +120,11 @@ def install(self, spec, prefix):
@run_after("install")
@on_package_attributes(run_tests=True)
def check_import(self):
if "+python" in self.spec:
self.run_test(
python.path,
["-c", "import open3d"],
purpose="checking import of open3d",
work_dir="spack-test",
)
def test_open3d_import(self):
"""Checking import of open3d"""
if "+python" not in self.spec:
return
with working_dir("spack-test"):
python = which(python.path)
python("-c", "import open3d")