瀏覽代碼

Solve windows env test fails (#437)

PeterYusuke 2 年之前
父節點
當前提交
07289c8735
共有 2 個文件被更改,包括 5 次插入2 次删除
  1. 2 2
      tests/test_app.py
  2. 3 0
      tests/test_state.py

+ 2 - 2
tests/test_app.py

@@ -97,7 +97,7 @@ def test_add_page_set_route(app: App, index_page, windows_platform: bool):
         index_page: The index page.
         windows_platform: Whether the system is windows.
     """
-    route = "\\test" if windows_platform else "/test"
+    route = "test" if windows_platform else "/test"
     assert app.pages == {}
     app.add_page(index_page, route=route)
     assert set(app.pages.keys()) == {"test"}
@@ -111,7 +111,7 @@ def test_add_page_set_route_nested(app: App, index_page, windows_platform: bool)
         index_page: The index page.
         windows_platform: Whether the system is windows.
     """
-    route = "\\test\\nested" if windows_platform else "/test/nested"
+    route = "test\\nested" if windows_platform else "/test/nested"
     assert app.pages == {}
     app.add_page(index_page, route=route)
     assert set(app.pages.keys()) == {route.strip(os.path.sep)}

+ 3 - 0
tests/test_state.py

@@ -21,6 +21,9 @@ class Object(Base):
 class TestState(State):
     """A test state."""
 
+    # Set this class as not test one
+    __test__ = False
+
     num1: int
     num2: float = 3.14
     key: str