mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-02-19 07:43:57 +08:00
pytest: strict config (#29676)
* pytest: strict config * collection works * fixes
This commit is contained in:
@@ -18,19 +18,18 @@ class TestPlotJuggler(unittest.TestCase):
|
||||
install()
|
||||
|
||||
pj = os.path.join(PJ_DIR, "juggle.py")
|
||||
p = subprocess.Popen(f'QT_QPA_PLATFORM=offscreen {pj} --demo None 1 --qlog',
|
||||
stderr=subprocess.PIPE, shell=True, start_new_session=True)
|
||||
with subprocess.Popen(f'QT_QPA_PLATFORM=offscreen {pj} --demo None 1 --qlog',
|
||||
stderr=subprocess.PIPE, shell=True, start_new_session=True) as p:
|
||||
# Wait for "Done reading Rlog data" signal from the plugin
|
||||
output = "\n"
|
||||
with Timeout(180, error_msg=output):
|
||||
while output.splitlines()[-1] != "Done reading Rlog data":
|
||||
output += p.stderr.readline().decode("utf-8")
|
||||
|
||||
# Wait for "Done reading Rlog data" signal from the plugin
|
||||
output = "\n"
|
||||
with Timeout(180, error_msg=output):
|
||||
while output.splitlines()[-1] != "Done reading Rlog data":
|
||||
output += p.stderr.readline().decode("utf-8")
|
||||
|
||||
# ensure plotjuggler didn't crash after exiting the plugin
|
||||
time.sleep(15)
|
||||
self.assertEqual(p.poll(), None)
|
||||
os.killpg(os.getpgid(p.pid), signal.SIGTERM)
|
||||
# ensure plotjuggler didn't crash after exiting the plugin
|
||||
time.sleep(15)
|
||||
self.assertEqual(p.poll(), None)
|
||||
os.killpg(os.getpgid(p.pid), signal.SIGTERM)
|
||||
|
||||
# TODO: also test that layouts successfully load
|
||||
def test_layouts(self):
|
||||
|
||||
Reference in New Issue
Block a user