浏览代码

Merge branch 'main' of github.com:zauberzeug/nicegui

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

+ 13 - 0
tests/test_pages.py

@@ -255,3 +255,16 @@ def test_exception_after_yield_on_async_page(screen: Screen):
     screen.open('/')
     screen.should_contain('this is shown')
     screen.assert_py_logger('ERROR', 'Failed to execute page-ready')
+
+
+def test_exception_in_on_page_ready_callback(screen: Screen):
+    def ready():
+        raise Exception('some exception')
+
+    @ui.page('/', on_page_ready=ready)
+    async def page() -> None:
+        ui.label('this is shown')
+
+    screen.open('/')
+    screen.should_contain('this is shown')
+    screen.assert_py_logger('ERROR', 'Failed to execute page-ready')