Skip to content

Commit

Permalink
Merge pull request #5455 from QCoDeS/dependabot/pip/websockets-approx…
Browse files Browse the repository at this point in the history
…-eq-12.0

Update websockets requirement from ~=11.0 to ~=12.0
  • Loading branch information
jenshnielsen authored Oct 23, 2023
2 parents f982e39 + 5ed73be commit ab06617
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ urllib3~=2.0.5
versioningit~=2.2.0
wcwidth==0.2.8
webencodings==0.5.1
websockets~=11.0
websockets~=12.0
widgetsnbextension~=4.0.3
wincertstore==0.2
wrapt~=1.15.0
Expand Down
19 changes: 8 additions & 11 deletions src/qcodes/tests/test_monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,8 @@ async def test_connection() -> None:
"""
Test that we can connect to a monitor instance
"""
# websockets.connect is exposed via some lazy global magic
# that pyright/mypy cannot figure out
async with websockets.connect( # type: ignore[attr-defined]
f"ws://localhost:{monitor.WEBSOCKET_PORT}"
):

async with websockets.connect(f"ws://localhost:{monitor.WEBSOCKET_PORT}"):
pass


Expand All @@ -125,13 +122,13 @@ async def test_instrument_update(inst_and_monitor) -> None:
Test instrument updates
"""
instr, my_monitor, monitor_parameters, param = inst_and_monitor
async with websockets.connect( # type: ignore[attr-defined]
async with websockets.connect(
f"ws://localhost:{monitor.WEBSOCKET_PORT}"
) as websocket:

# Receive data from monitor
data = await websocket.recv()
data = json.loads(data)
data_b = await websocket.recv()
data = json.loads(data_b)
# Check fields
assert "ts" in data
assert "parameters" in data
Expand Down Expand Up @@ -170,13 +167,13 @@ async def test_instrument_update(inst_and_monitor) -> None:
@pytest.mark.asyncio
async def test_monitor_root_instr(channel_instr_monitor) -> None:
_, use_root_instrument = channel_instr_monitor
async with websockets.connect( # type: ignore[attr-defined]
async with websockets.connect(
f"ws://localhost:{monitor.WEBSOCKET_PORT}"
) as websocket:

# Receive data from monitor
data = await websocket.recv()
data = json.loads(data)
data_b = await websocket.recv()
data = json.loads(data_b)
if use_root_instrument:
assert len(data["parameters"]) == 1
else:
Expand Down

0 comments on commit ab06617

Please sign in to comment.