Allow app harness tests to import State subclasses (#2408)

This commit is contained in:
Masen Furer 2024-01-18 12:54:29 -08:00 committed by GitHub
parent 1916cf2277
commit 6fcc4fd357
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -163,7 +163,9 @@ def get_app(reload: bool = False) -> ModuleType:
from reflex.state import State
# Reset rx.State subclasses to avoid conflict when reloading.
State.class_subclasses.clear()
for subclass in tuple(State.class_subclasses):
if subclass.__module__ == module:
State.class_subclasses.remove(subclass)
# Reload the app module.
importlib.reload(app)