diff --git a/pyproject.toml b/pyproject.toml index 53e3fe9eff69..3892ab02497d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -35,7 +35,7 @@ dependencies = [ "packaging>=20.0", "pandas>=1.5.0", "pyarrow>=11.0.0", # will become a requirement of pandas. Installing explicitly silences a warning - "pyvisa>=1.11.0, <1.16.0", + "pyvisa>=1.11.0, <1.17.0", "ruamel.yaml>=0.16.0,!=0.16.6", "tabulate>=0.9.0", "typing_extensions>=4.6.0", diff --git a/requirements.txt b/requirements.txt index f8cd6d0c444d..b9b0af62c4a4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -327,7 +327,7 @@ python-dateutil==2.9.0.post0 # pandas pytz==2025.2 # via pandas -pyvisa==1.15.0 +pyvisa==1.16.0 # via # qcodes (pyproject.toml) # pyvisa-sim diff --git a/tests/test_visa.py b/tests/test_visa.py index 5f2681582405..b74d607ab6ff 100644 --- a/tests/test_visa.py +++ b/tests/test_visa.py @@ -148,9 +148,12 @@ def use_magnet() -> pyvisa.ResourceManager: # and the instrument should no longer be in the instrument registry assert len(Instrument._all_instruments) == 0 assert len(rm.list_opened_resources()) == 0 - assert ( - caplog.records[-1].message == "Closing VISA handle to x as there are no non " - "weak references to the instrument." + # the order of the log messages depends on the pyvisa version but regardless + # of which version we should see the message about closing the handle + assert any( + record.message + == "Closing VISA handle to x as there are no non weak references to the instrument." + for record in caplog.records )