Skip to content

Commit 92f656e

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent f4c12c5 commit 92f656e

File tree

5 files changed

+13
-25
lines changed

5 files changed

+13
-25
lines changed

projectq/backends/_awsbraket/_awsbraket_boto3_client_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
""" Test for projectq.backends._awsbraket._awsbraket_boto3_client.py """
14+
"""Test for projectq.backends._awsbraket._awsbraket_boto3_client.py"""
1515

1616
import pytest
1717

@@ -282,7 +282,7 @@ def test_send_that_errors_are_caught(mocker, var_error, send_that_error_setup):
282282

283283

284284
@has_boto3
285-
@pytest.mark.parametrize("var_error", [('ResourceNotFoundException')])
285+
@pytest.mark.parametrize("var_error", ['ResourceNotFoundException'])
286286
def test_retrieve_error_arn_not_exist(mocker, var_error, arntask, creds):
287287
mock_boto3_client = mocker.MagicMock(spec=['get_quantum_task'])
288288
mock_boto3_client.get_quantum_task.side_effect = botocore.exceptions.ClientError(

projectq/backends/_awsbraket/_awsbraket_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
""" Test for projectq.backends._awsbraket._awsbraket.py"""
14+
"""Test for projectq.backends._awsbraket._awsbraket.py"""
1515

1616
import copy
1717
import math

projectq/backends/_circuits/_plot_test.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414
"""
15-
Tests for projectq.backends._circuits._plot.py.
15+
Tests for projectq.backends._circuits._plot.py.
1616
17-
To generate the baseline images,
18-
run the tests with '--mpl-generate-path=baseline'
17+
To generate the baseline images,
18+
run the tests with '--mpl-generate-path=baseline'
1919
20-
Then run the tests simply with '--mpl'
20+
Then run the tests simply with '--mpl'
2121
"""
2222
from copy import deepcopy
2323

projectq/backends/_ibm/_ibm_test.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -370,12 +370,8 @@ def mock_send(*args, **kwargs):
370370
assert prob_dict['00'] == pytest.approx(0.512)
371371
assert prob_dict['11'] == pytest.approx(0.488)
372372
result = "\nu2(0,pi/2) q[1];\ncx q[1], q[2];\ncx q[1], q[3];"
373-
if sys.version_info.major == 3:
374-
result += "\nu3(6.28318530718, 0, 0) q[1];\nu1(11.780972450962) q[1];"
375-
result += "\nu3(6.28318530718, 0, 0) q[1];\nu1(10.995574287564) q[1];"
376-
else:
377-
result += "\nu3(6.28318530718, 0, 0) q[1];\nu1(11.780972451) q[1];"
378-
result += "\nu3(6.28318530718, 0, 0) q[1];\nu1(10.9955742876) q[1];"
373+
result += "\nu3(6.28318530718, 0, 0) q[1];\nu1(11.780972450962) q[1];"
374+
result += "\nu3(6.28318530718, 0, 0) q[1];\nu1(10.995574287564) q[1];"
379375
result += "\nbarrier q[1], q[2], q[3];"
380376
result += "\nu3(0.2, -pi/2, pi/2) q[1];\nmeasure q[1] -> c[1];"
381377
result += "\nmeasure q[2] -> c[2];\nmeasure q[3] -> c[3];"

projectq/ops/_command_test.py

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -287,12 +287,8 @@ def test_command_str(main_engine):
287287
cmd.tags = ["TestTag"]
288288
cmd.add_control_qubits(ctrl_qubit)
289289
cmd2 = _command.Command(main_engine, Rx(0.5 * math.pi), (qubit,))
290-
if sys.version_info.major == 3:
291-
assert cmd.to_string(symbols=False) == "CRx(1.570796326795) | ( Qureg[1], Qureg[0] )"
292-
assert str(cmd2) == "Rx(1.570796326795) | Qureg[0]"
293-
else:
294-
assert cmd.to_string(symbols=False) == "CRx(1.5707963268) | ( Qureg[1], Qureg[0] )"
295-
assert str(cmd2) == "Rx(1.5707963268) | Qureg[0]"
290+
assert cmd.to_string(symbols=False) == "CRx(1.570796326795) | ( Qureg[1], Qureg[0] )"
291+
assert str(cmd2) == "Rx(1.570796326795) | Qureg[0]"
296292

297293

298294
def test_command_to_string(main_engine):
@@ -305,9 +301,5 @@ def test_command_to_string(main_engine):
305301

306302
assert cmd.to_string(symbols=True) == "CRx(0.5π) | ( Qureg[1], Qureg[0] )"
307303
assert cmd2.to_string(symbols=True) == "Rx(0.5π) | Qureg[0]"
308-
if sys.version_info.major == 3:
309-
assert cmd.to_string(symbols=False) == "CRx(1.570796326795) | ( Qureg[1], Qureg[0] )"
310-
assert cmd2.to_string(symbols=False) == "Rx(1.570796326795) | Qureg[0]"
311-
else:
312-
assert cmd.to_string(symbols=False) == "CRx(1.5707963268) | ( Qureg[1], Qureg[0] )"
313-
assert cmd2.to_string(symbols=False) == "Rx(1.5707963268) | Qureg[0]"
304+
assert cmd.to_string(symbols=False) == "CRx(1.570796326795) | ( Qureg[1], Qureg[0] )"
305+
assert cmd2.to_string(symbols=False) == "Rx(1.570796326795) | Qureg[0]"

0 commit comments

Comments
 (0)