瀏覽代碼

ensure we clear the storage dir after test completion (#3663)

Rodja Trappe 9 月之前
父節點
當前提交
c0a85d0230
共有 2 個文件被更改,包括 3 次插入0 次删除
  1. 2 0
      nicegui/storage.py
  2. 1 0
      nicegui/testing/general_fixtures.py

+ 2 - 0
nicegui/storage.py

@@ -212,3 +212,5 @@ class Storage:
         self._tabs.clear()
         for filepath in self.path.glob('storage-*.json'):
             filepath.unlink()
+        if self.path.exists():
+            self.path.rmdir()

+ 1 - 0
nicegui/testing/general_fixtures.py

@@ -52,6 +52,7 @@ def nicegui_reset_globals() -> Generator[None, None, None]:
     app.get('/')(Client.auto_index_client.build_response)
     binding.reset()
     yield
+    app.reset()
 
 
 def prepare_simulation(request: pytest.FixtureRequest) -> None: