Skip to content

Commit

Permalink
fix decorators bug with tests (#1021)
Browse files Browse the repository at this point in the history
  • Loading branch information
kt474 authored Aug 18, 2023
1 parent 01d4aa3 commit 83091ee
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion test/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def production_only(func):

@wraps(func)
def _wrapper(self, *args, **kwargs):
if "dev" in self.dependencies.url:
if "dev" in self.dependencies.url or "test" in self.dependencies.url:
raise SkipTest(f"Skipping integration test. {self} is not supported on staging.")
func(self, *args, **kwargs)

Expand Down Expand Up @@ -127,6 +127,7 @@ def _wrapper(self, *args, **kwargs):
service = None
if init_service:
service = QiskitRuntimeService(
instance=instance,
channel=channel,
token=token,
url=url,
Expand Down
1 change: 1 addition & 0 deletions test/integration/test_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ def test_run_program_cloud_no_backend(self, service):
job = self._run_program(service, backend="")
self.assertTrue(job.backend(), f"Job {job.job_id()} has no backend.")

@production_only
@run_integration_test
def test_run_program_log_level(self, service):
"""Test running with a custom log level."""
Expand Down
3 changes: 2 additions & 1 deletion test/integration/test_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from qiskit_ibm_runtime.exceptions import RuntimeJobFailureError

from ..ibm_test_case import IBMIntegrationTestCase
from ..decorators import run_integration_test
from ..decorators import run_integration_test, production_only


class TestIntegrationOptions(IBMIntegrationTestCase):
Expand Down Expand Up @@ -114,6 +114,7 @@ def test_unsupported_input_combinations(self, service):
inst.run(circ, observables=obs)
self.assertIn("a coupling map is required.", str(exc.exception))

@production_only
@run_integration_test
def test_all_resilience_levels(self, service):
"""Test that all resilience_levels are recognized correctly
Expand Down

0 comments on commit 83091ee

Please sign in to comment.