diff --git a/.github/CHANGELOG.md b/.github/CHANGELOG.md index 70a58851b1..af334b0a2b 100644 --- a/.github/CHANGELOG.md +++ b/.github/CHANGELOG.md @@ -27,6 +27,9 @@ * Fix failed tests for the non-binary wheel. [(#213)](https://github.com/PennyLaneAI/pennylane-lightning/pull/213) +* Fix failed tests on Windows. +[(#218)](https://github.com/PennyLaneAI/pennylane-lightning/pull/218) + ### Contributors This release contains contributions from (in alphabetical order): diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index 1821e4f465..c7090225af 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -68,7 +68,7 @@ jobs: access_token: ${{ github.token }} - name: Install dependencies - run: sudo apt update && sudo apt -y install clang-format-11 python3 + run: sudo apt update && sudo apt -y install clang-format-12 python3 - name: Checkout code uses: actions/checkout@v2 diff --git a/tests/test_adjoint_jacobian.py b/tests/test_adjoint_jacobian.py index 79a3464e6b..34557ae69f 100644 --- a/tests/test_adjoint_jacobian.py +++ b/tests/test_adjoint_jacobian.py @@ -159,6 +159,9 @@ def test_unsupported_hermitian_expectation(self, dev): ): dev.adjoint_jacobian(tape) + @pytest.mark.skipif( + not hasattr(np, "complex256"), reason="Numpy only defines complex256 in Linux-like system" + ) @pytest.mark.skipif(not lq._CPP_BINARY_AVAILABLE, reason="Lightning binary required") def test_unsupported_complex_type(self, dev): dev._state = dev._asarray(dev._state, np.complex256) diff --git a/tests/test_apply.py b/tests/test_apply.py index 7423122c6b..5d456872fe 100644 --- a/tests/test_apply.py +++ b/tests/test_apply.py @@ -89,6 +89,9 @@ class TestApply: from pennylane_lightning import LightningQubit as lq + @pytest.mark.skipif( + not hasattr(np, "complex256"), reason="Numpy only defines complex256 in Linux-like system" + ) @pytest.mark.skipif(not lq._CPP_BINARY_AVAILABLE, reason="Lightning binary required") def test_apply_operation_raise_type_error(self, qubit_device_1_wire): """Tests that applying an operation yields the expected output state for single wire diff --git a/tests/test_vector_jacobian_product.py b/tests/test_vector_jacobian_product.py index 8f25758456..791bc8627a 100644 --- a/tests/test_vector_jacobian_product.py +++ b/tests/test_vector_jacobian_product.py @@ -35,6 +35,9 @@ class TestComputeVJP: def dev(self): return qml.device("lightning.qubit", wires=2) + @pytest.mark.skipif( + not hasattr(np, "complex256"), reason="Numpy only defines complex256 in Linux-like system" + ) def test_unsupported_complex_type(self, dev): dev._state = dev._asarray(dev._state, np.complex256) @@ -113,6 +116,9 @@ class TestVectorJacobianProduct: def dev(self): return qml.device("lightning.qubit", wires=2) + @pytest.mark.skipif( + not hasattr(np, "complex256"), reason="Numpy only defines complex256 in Linux-like system" + ) def test_unsupported_complex_type(self, dev): dev._state = dev._asarray(dev._state, np.complex256) @@ -438,6 +444,9 @@ class TestBatchVectorJacobianProduct: def dev(self): return qml.device("lightning.qubit", wires=2) + @pytest.mark.skipif( + not hasattr(np, "complex256"), reason="Numpy only defines complex256 in Linux-like system" + ) def test_unsupported_complex_type(self, dev): dev._state = dev._asarray(dev._state, np.complex256)