Skip to content

Commit

Permalink
handle that newer versions of qcodes does not register broken instrum…
Browse files Browse the repository at this point in the history
…ents
  • Loading branch information
jenshnielsen committed Feb 10, 2022
1 parent 422d631 commit 7af3a32
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions qcodes_contrib_drivers/tests/QDevil/test_sim_qdac2_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@ def test_refuse_wrong_model():
# -----------------------------------------------------------------------
assert 'Unknown model' in repr(error)
# Circumvent Instrument not handling exceptions in constructor.
Instrument._all_instruments.pop(wrong_instrument)

# In qcodes < 0.32
try:
Instrument._all_instruments.pop(wrong_instrument)
except KeyError:
pass

def test_refuse_incompatible_firmware():
# -----------------------------------------------------------------------
Expand All @@ -23,4 +26,8 @@ def test_refuse_incompatible_firmware():
# -----------------------------------------------------------------------
assert 'Incompatible firmware' in repr(error)
# Circumvent Instrument not handling exceptions in constructor.
Instrument._all_instruments.pop('qdac')
# In qcodes < 0.32
try:
Instrument._all_instruments.pop('qdac')
except KeyError:
pass

0 comments on commit 7af3a32

Please sign in to comment.