diff --git a/requirements-dev.txt b/requirements-dev.txt index 99afaa1..3c1c20c 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,3 +1,5 @@ ruff pylint +black +isort pre-commit diff --git a/tests/test_device.py b/tests/test_device.py index 92f3942..e84634f 100755 --- a/tests/test_device.py +++ b/tests/test_device.py @@ -130,7 +130,8 @@ def test_api_key_not_found_error(self, monkeypatch, tmpdir): monkeypatch.setattr("os.curdir", tmpdir.join("folder_without_a_config_file")) monkeypatch.setattr( - "pennylane.default_config", qml.Configuration("config.toml"), + "pennylane.default_config", + qml.Configuration("config.toml"), ) # force loading of config with pytest.raises(ValueError, match="No valid api key for AQT platform found"): AQTDevice(2) @@ -222,7 +223,8 @@ def test_apply_operation_S(self, wires): @pytest.mark.parametrize("wires", [[0], [1], [2]]) @pytest.mark.parametrize( - ("op", "aqt_name"), [(qml.PauliX, "X"), (qml.PauliY, "Y"), (qml.PauliZ, "Z")], + ("op", "aqt_name"), + [(qml.PauliX, "X"), (qml.PauliY, "Y"), (qml.PauliZ, "Z")], ) def test_apply_operation_pauli(self, wires, op, aqt_name): """Tests that the _apply_operation method correctly populates the circuit @@ -438,7 +440,8 @@ def test_api_key_not_found_error(self, monkeypatch, tmpdir): monkeypatch.setattr("os.curdir", tmpdir.join("folder_without_a_config_file")) monkeypatch.setattr( - "pennylane.default_config", qml.Configuration("config.toml"), + "pennylane.default_config", + qml.Configuration("config.toml"), ) # force loading of config with pytest.raises(ValueError, match="No valid api key for AQT platform found"): qml.device("aqt.sim", 2) @@ -451,7 +454,8 @@ def test_device_gets_local_config(self, monkeypatch, tmpdir): tmpdir.join("config.toml").write(test_config) monkeypatch.setattr("os.curdir", tmpdir) monkeypatch.setattr( - "pennylane.default_config", qml.Configuration("config.toml"), + "pennylane.default_config", + qml.Configuration("config.toml"), ) # force loading of config dev = qml.device("aqt.sim", wires=2) @@ -470,7 +474,8 @@ def test_device_gets_api_key_default_config_directory(self, monkeypatch, tmpdir) config_dir = tmpdir.mkdir("pennylane") # fake default config directory config_dir.join("config.toml").write(test_config) monkeypatch.setenv( - "XDG_CONFIG_HOME", os.path.expanduser(tmpdir), + "XDG_CONFIG_HOME", + os.path.expanduser(tmpdir), ) # HACK: only works on linux monkeypatch.setattr("os.curdir", tmpdir.join("folder_without_a_config_file")) @@ -495,7 +500,8 @@ def test_device_gets_api_key_pennylane_conf_env_var(self, monkeypatch, tmpdir): monkeypatch.setattr("os.curdir", tmpdir.join("folder_without_a_config_file")) monkeypatch.setattr( - "pennylane.default_config", qml.Configuration("config.toml"), + "pennylane.default_config", + qml.Configuration("config.toml"), ) # force loading of config dev = qml.device("aqt.sim", wires=2)