openpmd-api: Changed from old to new test API (#44764)

* changed from old to new test API
* changed test name so it works
* small docstring change
* fixed skiptest check
* made tests check output
This commit is contained in:
AcriusWinter 2024-06-20 15:06:48 -07:00 committed by GitHub
parent 901f4b789d
commit 8f0b029308
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -172,17 +172,10 @@ def check(self):
# later tests
ctest("--output-on-failure", "-j1")
def test(self):
"""Perform smoke tests on the installed package."""
exes = ["openpmd-ls"] # in 0.11.1+
for exe in exes:
spec_vers_str = "{0}".format(self.spec.version)
reason = "test version of {0} is {1}".format(exe, spec_vers_str)
self.run_test(
exe,
["--version"],
[spec_vers_str],
installed=True,
purpose=reason,
skip_missing=False,
)
def test_run_openpmd_ls(self):
"""Test if openpmd-ls runs correctly"""
if self.spec.satisfies("@:0.11.0"):
raise SkipTest("Package must be installed as version 0.11.1 or later")
exe = which(join_path(self.prefix.bin, "openpmd-ls"))
out = exe(output=str.split, error=str.split)
assert str(self.spec.version) in out