MCPcopy Create free account
hub / github.com/LibrePCB/LibrePCB / wait_for_item

Method wait_for_item

tests/ui/conftest.py:280–293  ·  view source on GitHub ↗
(self, test, timeout=10.0)

Source from the content-addressed store, hash-verified

278 time.sleep(0.01)
279
280 def wait_for_item(self, test, timeout=10.0):
281 start = time.time()
282 while True:
283 self.refresh()
284 for result in self._results:
285 if test(result):
286 return result
287 if time.time() - start > timeout:
288 self.save_screenshot()
289 raise TimeoutError(
290 f"Waiting for item timed out: {self._query} "
291 + "-- Screenshot saved."
292 )
293 time.sleep(0.01)
294
295 def read(self, keys, indices=None):
296 """

Callers 1

test_file_tree_dclickFunction · 0.80

Calls 3

refreshMethod · 0.95
save_screenshotMethod · 0.95
testFunction · 0.50

Tested by

no test coverage detected