Skip to content

Commit

Permalink
test: Ensure that capellambse is installed
Browse files Browse the repository at this point in the history
Raise an error if we detect that the built-in model extensions weren't
found in the entry points, as that would lead to a lot of follow-up
errors in the test suite.
  • Loading branch information
Wuestengecko committed Mar 5, 2024
1 parent 6789849 commit 049b8ee
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# SPDX-License-Identifier: Apache-2.0
"""Global fixtures for pytest."""
import collections.abc as cabc
import importlib.metadata as imm
import io
import pathlib
import sys
Expand All @@ -17,6 +18,15 @@

capellambse.load_model_extensions()

if not any(
i.module.startswith("capellambse.extensions.")
for i in imm.entry_points(group="capellambse.model_extensions")
):
raise RuntimeError(
"Built-in model extensions are not loaded,"
" is capellambse installed properly?"
)


@pytest.fixture(scope="session")
def session_shared_model() -> cabc.Iterator[capellambse.MelodyModel]:
Expand Down

0 comments on commit 049b8ee

Please sign in to comment.