test/patch.py: switch tests to use mock_packages (#50337)

This commit is contained in:
Tamara Dahlgren 2025-05-06 23:07:11 -07:00 committed by GitHub
parent a3a49daf8f
commit 931d034da4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -89,7 +89,7 @@ def mock_patch_stage(tmpdir_factory, monkeypatch):
(os.path.join(data_path, "foo.patch"), platform_url_sha, None), (os.path.join(data_path, "foo.patch"), platform_url_sha, None),
], ],
) )
def test_url_patch(mock_patch_stage, filename, sha256, archive_sha256, config): def test_url_patch(mock_packages, mock_patch_stage, filename, sha256, archive_sha256, config):
# Make a patch object # Make a patch object
url = url_util.path_to_file_url(filename) url = url_util.path_to_file_url(filename)
s = spack.concretize.concretize_one("patch") s = spack.concretize.concretize_one("patch")
@ -466,7 +466,7 @@ def test_equality():
assert patch1 != "not a patch" assert patch1 != "not a patch"
def test_sha256_setter(mock_patch_stage, config): def test_sha256_setter(mock_packages, mock_patch_stage, config):
path = os.path.join(data_path, "foo.patch") path = os.path.join(data_path, "foo.patch")
s = spack.concretize.concretize_one("patch") s = spack.concretize.concretize_one("patch")
patch = spack.patch.FilePatch(s.package, path, level=1, working_dir=".") patch = spack.patch.FilePatch(s.package, path, level=1, working_dir=".")