Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ repos:

## Check JSON schemata
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.37.2
rev: 0.37.3
hooks:
- id: check-github-workflows
priority: 0
Expand All @@ -45,14 +45,14 @@ repos:

## Check pyproject.toml file
- repo: https://github.com/henryiii/validate-pyproject-schema-store
rev: 2026.06.12
rev: 2026.06.14
hooks:
- id: validate-pyproject
priority: 0

## Ensure uv.lock is up to date
- repo: https://github.com/astral-sh/uv-pre-commit
rev: 0.11.19
rev: 0.11.21
hooks:
- id: uv-lock
priority: 0
Expand Down Expand Up @@ -102,7 +102,7 @@ repos:

## Format configuration files with prettier
- repo: https://github.com/rbubley/mirrors-prettier
rev: v3.8.3
rev: v3.8.4
hooks:
- id: prettier
types_or: [yaml, markdown, html, css, scss, javascript, json, json5]
Expand All @@ -128,7 +128,7 @@ repos:

## Format and lint Python files with ruff
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.16
rev: v0.15.17
hooks:
- id: ruff-check
require_serial: true
Expand All @@ -139,7 +139,7 @@ repos:

## Check Python types with ty
- repo: https://github.com/astral-sh/ty-pre-commit
rev: v0.0.47
rev: v0.0.49
hooks:
- id: ty
args: [--only-dev]
Expand Down
14 changes: 13 additions & 1 deletion test/test_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
MLIR_FILE_TO_CATALYST = "3_AfterToCatalystQuantum.mlir"


@pytest.fixture(autouse=True)
@pytest.fixture
def _cleanup_mlir_files() -> Generator[None, None, None]:
"""Clean up MLIR files before and after each test to ensure test isolation.

Expand Down Expand Up @@ -240,6 +240,7 @@ def _verify_roundtrip(
_run_filecheck(mlir_after_roundtrip, check_after, f"{test_name}: MQTOpt to CatalystQuantum")


@pytest.mark.usefixtures("_cleanup_mlir_files")
def test_paulix_roundtrip() -> None:
"""Test roundtrip conversion of the PauliX gate."""

Expand Down Expand Up @@ -288,6 +289,7 @@ def module() -> Any: # noqa: ANN401
_verify_roundtrip("PauliX", check_mlir_before, check_after_mqtopt, check_after_catalyst)


@pytest.mark.usefixtures("_cleanup_mlir_files")
def test_pauliy_roundtrip() -> None:
"""Test roundtrip conversion of the PauliY gate."""

Expand Down Expand Up @@ -336,6 +338,7 @@ def module() -> Any: # noqa: ANN401
_verify_roundtrip("PauliY", check_mlir_before, check_after_mqtopt, check_after_catalyst)


@pytest.mark.usefixtures("_cleanup_mlir_files")
def test_pauliz_roundtrip() -> None:
"""Test roundtrip conversion of the PauliZ gate."""

Expand Down Expand Up @@ -384,6 +387,7 @@ def module() -> Any: # noqa: ANN401
_verify_roundtrip("PauliZ", check_mlir_before, check_after_mqtopt, check_after_catalyst)


@pytest.mark.usefixtures("_cleanup_mlir_files")
def test_hadamard_roundtrip() -> None:
"""Test roundtrip conversion of the Hadamard gate."""

Expand Down Expand Up @@ -423,6 +427,7 @@ def module() -> Any: # noqa: ANN401
_verify_roundtrip("Hadamard", check_mlir_before, check_after_mqtopt, check_after_catalyst)


@pytest.mark.usefixtures("_cleanup_mlir_files")
def test_s_gate_roundtrip() -> None:
"""Test roundtrip conversion of the S gate."""

Expand Down Expand Up @@ -461,6 +466,7 @@ def module() -> Any: # noqa: ANN401
_verify_roundtrip("S", check_mlir_before, check_after_mqtopt, check_after_catalyst)


@pytest.mark.usefixtures("_cleanup_mlir_files")
def test_t_gate_roundtrip() -> None:
"""Test roundtrip conversion of the T gate."""

Expand Down Expand Up @@ -500,6 +506,7 @@ def module() -> Any: # noqa: ANN401
_verify_roundtrip("T", check_mlir_before, check_after_mqtopt, check_after_catalyst)


@pytest.mark.usefixtures("_cleanup_mlir_files")
def test_rx_gate_roundtrip() -> None:
"""Test roundtrip conversion of the RX gate."""

Expand Down Expand Up @@ -543,6 +550,7 @@ def module() -> Any: # noqa: ANN401
_verify_roundtrip("RX", check_mlir_before, check_after_mqtopt, check_after_catalyst)


@pytest.mark.usefixtures("_cleanup_mlir_files")
def test_ry_gate_roundtrip() -> None:
"""Test roundtrip conversion of the RY gate."""

Expand Down Expand Up @@ -586,6 +594,7 @@ def module() -> Any: # noqa: ANN401
_verify_roundtrip("RY", check_mlir_before, check_after_mqtopt, check_after_catalyst)


@pytest.mark.usefixtures("_cleanup_mlir_files")
def test_rz_gate_roundtrip() -> None:
"""Test roundtrip conversion of the RZ gate."""

Expand Down Expand Up @@ -629,6 +638,7 @@ def module() -> Any: # noqa: ANN401
_verify_roundtrip("RZ", check_mlir_before, check_after_mqtopt, check_after_catalyst)


@pytest.mark.usefixtures("_cleanup_mlir_files")
def test_phaseshift_gate_roundtrip() -> None:
"""Test roundtrip conversion of the PhaseShift gate."""

Expand Down Expand Up @@ -668,6 +678,7 @@ def module() -> Any: # noqa: ANN401
_verify_roundtrip("PhaseShift", check_mlir_before, check_after_mqtopt, check_after_catalyst)


@pytest.mark.usefixtures("_cleanup_mlir_files")
def test_swap_gate_roundtrip() -> None:
"""Test roundtrip conversion of the SWAP gate."""

Expand Down Expand Up @@ -707,6 +718,7 @@ def module() -> Any: # noqa: ANN401
_verify_roundtrip("SWAP", check_mlir_before, check_after_mqtopt, check_after_catalyst)


@pytest.mark.usefixtures("_cleanup_mlir_files")
def test_toffoli_gate_roundtrip() -> None:
"""Test roundtrip conversion of the Toffoli gate."""

Expand Down
Loading