Allow app harness tests to import State subclasses (#2408)
This commit is contained in:
parent
1916cf2277
commit
6fcc4fd357
@ -163,7 +163,9 @@ def get_app(reload: bool = False) -> ModuleType:
|
|||||||
from reflex.state import State
|
from reflex.state import State
|
||||||
|
|
||||||
# Reset rx.State subclasses to avoid conflict when reloading.
|
# 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.
|
# Reload the app module.
|
||||||
importlib.reload(app)
|
importlib.reload(app)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user