unit tests: switch test/cmd/versions to mock packages (#50315)
This commit is contained in:
parent
6219780691
commit
ecb122f4c1
@ -10,6 +10,9 @@
|
||||
versions = SpackCommand("versions")
|
||||
|
||||
|
||||
pytestmark = [pytest.mark.usefixtures("mock_packages")]
|
||||
|
||||
|
||||
def test_safe_versions():
|
||||
"""Only test the safe versions of a package."""
|
||||
|
||||
@ -70,11 +73,11 @@ def test_no_unchecksummed_versions():
|
||||
def test_versions_no_url():
|
||||
"""Test a package with versions but without a ``url`` attribute."""
|
||||
|
||||
versions("graphviz")
|
||||
versions("attributes-foo-app")
|
||||
|
||||
|
||||
@pytest.mark.maybeslow
|
||||
def test_no_versions_no_url():
|
||||
"""Test a package without versions or a ``url`` attribute."""
|
||||
|
||||
versions("opengl")
|
||||
versions("no-url-or-version")
|
||||
|
@ -0,0 +1,11 @@
|
||||
# Copyright Spack Project Developers. See COPYRIGHT file for details.
|
||||
#
|
||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
|
||||
from spack.package import *
|
||||
|
||||
|
||||
class NoUrlOrVersion(Package):
|
||||
"""Mock package that has no url and no version."""
|
||||
|
||||
homepage = "https://example.com/"
|
Loading…
Reference in New Issue
Block a user