1
0
Эх сурвалжийг харах

try to fix tests by clearing app.user_middlewares

Rodja Trappe 2 жил өмнө
parent
commit
f96527836d
1 өөрчлөгдсөн 1 нэмэгдсэн , 0 устгасан
  1. 1 0
      tests/conftest.py

+ 1 - 0
tests/conftest.py

@@ -40,6 +40,7 @@ def reset_globals() -> Generator[None, None, None]:
     for path in {'/'}.union(globals.page_routes.values()):
         globals.app.remove_route(path)
     globals.app.middleware_stack = None
+    globals.app.user_middleware.clear()
     # NOTE favicon routes must be removed separately because they are not "pages"
     [globals.app.routes.remove(r) for r in globals.app.routes if r.path.endswith('/favicon.ico')]
     importlib.reload(globals)