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