Skip to content

Commit

Permalink
Update test_refresh_method (#2074)
Browse files Browse the repository at this point in the history
  • Loading branch information
kt474 authored Dec 5, 2024
1 parent 37dee1a commit 62735e3
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
5 changes: 1 addition & 4 deletions qiskit_ibm_runtime/fake_provider/fake_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,6 @@ def refresh(self, service: QiskitRuntimeService) -> None:
" required to retrieve the real backend's current properties and settings."
)

version = self.backend_version
prod_name = self.backend_name.replace("fake", "ibm")
try:
backends = service.backends(prod_name)
Expand Down Expand Up @@ -633,10 +632,8 @@ def refresh(self, service: QiskitRuntimeService) -> None:
)

logger.info(
"The backend %s has been updated from version %s to %s version.",
"The backend %s has been updated with the latest data from the server.",
self.backend_name,
version,
real_props.backend_version,
)

except Exception as ex: # pylint: disable=broad-except
Expand Down
7 changes: 0 additions & 7 deletions test/integration/test_fake_backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,13 +175,6 @@ def test_refresh_method(self):
old_backend.refresh(self.service)
self.assertIn("The backend fake_sherbrooke has been updated", logs.output[0])

# to verify the data files are currently updated that there is nothing to refresh
# create another instance of FakeSherbrooke updated above
new_backend = FakeSherbrooke()
with self.assertLogs("qiskit_ibm_runtime", level="INFO") as logs:
new_backend.refresh(self.service)
self.assertIn("There are no available new updates for fake_sherbrooke", logs.output[0])

# to verify the refresh can't be done
wrong_backend = FakeSherbrooke()
# set a non-existent backend name
Expand Down

0 comments on commit 62735e3

Please sign in to comment.