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
4 changes: 2 additions & 2 deletions cirq-google/cirq_google/engine/engine_processor_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -808,7 +808,7 @@ def test_get_schedule_time_filter_behavior(list_time_slots):
processor.get_schedule(from_time=datetime.timedelta(seconds=200), to_time=None)
list_time_slots.assert_called_with('proj', 'p0', f'end_time > {now + 200}')

test_timestamp = datetime.datetime.utcfromtimestamp(52)
test_timestamp = datetime.datetime.fromtimestamp(52, datetime.UTC)
utc_ts = int(test_timestamp.timestamp())
processor.get_schedule(from_time=test_timestamp, to_time=None)
list_time_slots.assert_called_with('proj', 'p0', f'end_time > {utc_ts}')
Expand Down Expand Up @@ -852,7 +852,7 @@ def test_list_reservations_time_filter_behavior(list_reservations):
processor.list_reservations(from_time=datetime.timedelta(seconds=200), to_time=None)
list_reservations.assert_called_with('proj', 'p0', f'end_time > {now + 200}')

test_timestamp = datetime.datetime.utcfromtimestamp(52)
test_timestamp = datetime.datetime.fromtimestamp(52, datetime.UTC)
utc_ts = int(test_timestamp.timestamp())
processor.list_reservations(from_time=test_timestamp, to_time=None)
list_reservations.assert_called_with('proj', 'p0', f'end_time > {utc_ts}')
Expand Down
2 changes: 1 addition & 1 deletion cirq-ionq/cirq_ionq/ionq_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ def list_calibrations(
"""

params = {}
epoch = datetime.datetime.utcfromtimestamp(0)
epoch = datetime.datetime.fromtimestamp(0, datetime.UTC)
if start:
params['start'] = int((start - epoch).total_seconds() * 1000)
if end:
Expand Down
6 changes: 3 additions & 3 deletions cirq-ionq/cirq_ionq/ionq_client_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def test_ionq_client_invalid_remote_host():
for invalid_url in ('', 'url', 'http://', 'ftp://', 'http://'):
with pytest.raises(AssertionError, match='not a valid url'):
_ = ionq.ionq_client._IonQClient(remote_host=invalid_url, api_key='a')
with pytest.raises(AssertionError, match=invalid_url):
with pytest.raises(AssertionError, match=invalid_url or None):
_ = ionq.ionq_client._IonQClient(remote_host=invalid_url, api_key='a')


Expand Down Expand Up @@ -1050,8 +1050,8 @@ def test_ionq_client_list_calibrations_dates(mock_get):
mock_get.return_value.json.return_value = {'calibrations': [{'id': '1'}, {'id': '2'}]}
client = ionq.ionq_client._IonQClient(remote_host='http://example.com', api_key='to_my_heart')
response = client.list_calibrations(
start=datetime.datetime.utcfromtimestamp(1284286794),
end=datetime.datetime.utcfromtimestamp(1284286795),
start=datetime.datetime.fromtimestamp(1284286794, datetime.UTC),
end=datetime.datetime.fromtimestamp(1284286795, datetime.UTC),
)
assert response == [{'id': '1'}, {'id': '2'}]

Expand Down
4 changes: 2 additions & 2 deletions cirq-ionq/cirq_ionq/service_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,8 @@ def test_service_list_calibrations():
calibrations = [{'id': '1', 'qubits': '1'}, {'id': '2', 'qubits': 2}]
mock_client.list_calibrations.return_value = calibrations
service._client = mock_client
start = datetime.datetime.utcfromtimestamp(1284286794)
end = datetime.datetime.utcfromtimestamp(1284286795)
start = datetime.datetime.fromtimestamp(1284286794, datetime.UTC)
end = datetime.datetime.fromtimestamp(1284286795, datetime.UTC)

listed_calibrations = service.list_calibrations(start=start, end=end, limit=10, batch_size=2)
assert listed_calibrations[0].num_qubits() == 1
Expand Down