浏览代码

try waiting for caplog

Falko Schindler 2 年之前
父节点
当前提交
bfd62b47e3
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      tests/screen.py

+ 1 - 0
tests/screen.py

@@ -127,6 +127,7 @@ class Screen:
         self.selenium.get_screenshot_as_file(filename)
 
     def assert_py_logger(self, *logs: str) -> None:
+        self.wait(1.0)  # NOTE: wait for caplog
         assert len(self.caplog.records) == len(logs), \
             f'Expected {len(logs)} log message(s) but got {len(self.caplog.records)}'
         for log, record in zip(logs, self.caplog.records):