Fix failing tests

This commit is contained in:
Jan Käberich 2024-04-20 15:57:16 +02:00
parent 2963e8b3d5
commit a202a10507
4 changed files with 18 additions and 11 deletions

View file

@ -32,6 +32,8 @@ class TestBase(unittest.TestCase):
if self.vna.query(":DEV:CONN?") == "Not connected":
self.tearDown()
raise AssertionError("Not connected")
# Tests occasionally fail without this timeout - give GUI a little bit more time to properly start
time.sleep(1)
def tearDown(self):
self.gui.send_signal(SIGINT)

View file

@ -8,7 +8,7 @@ class TestCalibration(TestBase):
self.vna.cmd(":VNA:CAL:MEAS "+str(number))
# wait for the measurement to finish
assert self.vna.query(":VNA:CAL:BUSY?") == "TRUE"
self.vna.cmd("*WAI")
self.vna.cmd("*WAI", timeout=timeout)
assert self.vna.query(":VNA:CAL:BUSY?") == "FALSE"
def test_dummy_calibration(self):
@ -152,9 +152,9 @@ class TestCalibration(TestBase):
# Start measurement and grab data
self.vna.cmd(":VNA:ACQ:SINGLE TRUE")
self.assertEqual(self.vna.query(":VNA:ACQ:FIN?") == "FALSE")
self.assertEqual(self.vna.query(":VNA:ACQ:FIN?"), "FALSE")
self.vna.cmd("*WAI")
self.assertEqual(self.vna.query(":VNA:ACQ:FIN?") == "TRUE")
self.assertEqual(self.vna.query(":VNA:ACQ:FIN?"), "TRUE")
cal.reset()

View file

@ -1,5 +1,6 @@
import re
from tests.TestBase import TestBase
import time
float_re = re.compile(r'^[-+]?(\d+(\.\d*)?|\.\d+)([eE][-+]\d+)?$')
int_re = re.compile(r'^\d+$')
@ -240,7 +241,4 @@ class TestRST(TestBase):
self.vna.cmd("*RST")
settings2 = self.query_settings()
for key, value in settings1.items():
# TODO-check: *RST does not reset this parameter.
if key == "DEV:REF:OUT":
continue
self.assertEqual(value, settings2[key])