Bugfix: allow test_* build-time and stand-alone tests (#45699)

This commit is contained in:
Tamara Dahlgren 2024-08-13 16:58:00 -07:00 committed by GitHub
parent e40c10509d
commit 8ba6e7eed2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 0 deletions

View File

@ -757,6 +757,10 @@ def test_process(pkg: Pb, kwargs):
pkg.tester.status(pkg.spec.name, TestStatus.SKIPPED)
return
# Make sure properly named build-time test methods actually run as
# stand-alone tests.
pkg.run_tests = True
# run test methods from the package and all virtuals it provides
v_names = virtuals(pkg)
test_specs = [pkg.spec] + [spack.spec.Spec(v_name) for v_name in sorted(v_names)]

View File

@ -101,6 +101,7 @@ def setup_dependent_build_environment(self, env, dependent_spec):
@run_after("install")
@on_package_attributes(run_tests=True)
def test_install(self):
"""Run pytest tests"""
# https://shapely.readthedocs.io/en/latest/installation.html#testing-shapely
if self.version >= Version("2"):
with working_dir("spack-test", create=True):