There was an error while loading. Please reload this page.
1 parent 2281ea5 commit 5760fb3Copy full SHA for 5760fb3
1 file changed
meshtastic/tests/conftest.py
@@ -49,8 +49,17 @@ def firmware_node():
49
_skip_firmware_if_unavailable()
50
mesh = SimMesh(n_nodes=1, base_port=SINGLE_NODE_BASE_PORT)
51
mesh.start()
52
- set_region(mesh.get_node(0).port, "US")
53
- yield mesh.get_node(0)
+ node = mesh.get_node(0)
+ set_region(node.port, "US")
54
+ # The region commit restarts the TCP listener, so reconnect the harness
55
+ # interface in case a test wants to use it directly.
56
+ if node.iface is not None:
57
+ try:
58
+ node.iface.close()
59
+ except Exception: # pylint: disable=broad-except
60
+ pass
61
+ node.connect()
62
+ yield node
63
mesh.stop()
64
65
0 commit comments