diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 4a84120..4c5f282 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -20,4 +20,4 @@ jobs: - name: Install project run: python -m pip install .[testsuite] - name: Run unit tests on Python ${{ matrix.python-version }} on ${{ matrix.os }} - run: pytest tests -vv --cov + run: pytest diff --git a/pyproject.toml b/pyproject.toml index 2928517..7e2dcb0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -60,8 +60,10 @@ linting = [ "ruff >= 0.3", ] testsuite = [ + "npe2", "pytest >= 7.1.0", "pytest-cov >= 5.0.0", + "typer", ] [tool.codespell] @@ -91,6 +93,9 @@ disallow_subclassing_any = true implicit_optional = false strict_optional = true +[tool.pytest.ini_options] +addopts = "-vv --cov looptrace_loci_vis --cov-report term-missing" + [tool.ruff] # Black uses line-length = 88, but allows exceptions when breaking the line # would lead to other rule violations. Use 100 as a maximum hard limit: diff --git a/tests/test_manifest_validation.py b/tests/test_manifest_validation.py new file mode 100644 index 0000000..8dec164 --- /dev/null +++ b/tests/test_manifest_validation.py @@ -0,0 +1,12 @@ +"""Test that the plugin will be able to be used by Napari.""" + +import npe2.cli +import pytest +import typer + + +def test_plugin_package_manifest_is_valid(): + try: + npe2.cli.validate("looptrace-loci-vis") + except typer.Exit as e: + pytest.fail(f"Manifest validation failed: {e}")