Skip to content

Commit

Permalink
Merge cd37470 into c332167
Browse files Browse the repository at this point in the history
  • Loading branch information
kt474 committed Aug 10, 2023
2 parents c332167 + cd37470 commit 4898690
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions test/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from dataclasses import dataclass
from functools import wraps
from typing import Callable, Optional
from unittest import SkipTest

from qiskit_ibm_provider import IBMProvider, least_busy
from .unit.mock.fake_provider import FakeProvider
Expand Down Expand Up @@ -49,6 +50,7 @@ def integration_test_setup_with_backend(
backend_name: Optional[str] = None,
simulator: Optional[bool] = True,
min_num_qubits: Optional[int] = None,
staging: Optional[bool] = True,
) -> Callable:
"""Returns a decorator that retrieves the appropriate backend to use for testing.
Expand All @@ -70,6 +72,8 @@ def _decorator(func):
def _wrapper(self, *args, **kwargs):
dependencies: IntegrationTestDependencies = kwargs["dependencies"]
provider: IBMProvider = dependencies.provider
if not staging:
raise SkipTest("Tests not supported on staging.")
if backend_name:
_backend = provider.get_backend(
name=backend_name, instance=dependencies.instance
Expand Down
2 changes: 1 addition & 1 deletion test/integration/test_filter_backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class TestBackendFilters(IBMTestCase):
"""Qiskit Backend Filtering Tests."""

@classmethod
@integration_test_setup_with_backend()
@integration_test_setup_with_backend(staging=False)
def setUpClass(
cls, backend: IBMBackend, dependencies: IntegrationTestDependencies
) -> None:
Expand Down
1 change: 1 addition & 0 deletions test/integration/test_ibm_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ def test_retrieve_pending_jobs(self):

def test_retrieve_running_error_jobs(self):
"""Test client side filtering with running and error jobs."""
self.sim_job.wait_for_final_state()
statuses = ["RUNNING", JobStatus.ERROR]
job_list = self.provider.backend.jobs(
backend_name=self.sim_backend.name, limit=3, status=statuses
Expand Down
2 changes: 2 additions & 0 deletions test/integration/test_ibm_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ def test_active_account_instance(self):

def test_active_account_with_saved_instance(self):
"""Test active_account with a saved instance."""
if "dev" in self.dependencies.url:
self.skipTest("Test not supported on staging")
hgp = self.provider._get_hgp()
name = "foo"
with temporary_account_config_file(
Expand Down

0 comments on commit 4898690

Please sign in to comment.