Parcourir la source

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

Rodja Trappe il y a 8 mois
Parent
commit
c0a85d0230
2 fichiers modifiés avec 3 ajouts et 0 suppressions
  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: