From 634c0916f6a893caa56b9aa8eb7a0c1159debd99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Brand=C3=A9ho?= Date: Tue, 13 Aug 2024 23:14:38 +0200 Subject: [PATCH] do not reload compilation if using local app in AppHarness (#3790) * do not reload if using local app * Update reflex/testing.py Co-authored-by: Masen Furer --------- Co-authored-by: Masen Furer --- reflex/testing.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/reflex/testing.py b/reflex/testing.py index 52bff03c0..c52396fc6 100644 --- a/reflex/testing.py +++ b/reflex/testing.py @@ -276,7 +276,10 @@ class AppHarness: before_decorated_pages = reflex.app.DECORATED_PAGES[self.app_name].copy() # Ensure the AppHarness test does not skip State assignment due to running via pytest os.environ.pop(reflex.constants.PYTEST_CURRENT_TEST, None) - self.app_module = reflex.utils.prerequisites.get_compiled_app(reload=True) + self.app_module = reflex.utils.prerequisites.get_compiled_app( + # Do not reload the module for pre-existing apps (only apps generated from source) + reload=self.app_source is not None + ) # Save the pages that were added during testing self._decorated_pages = [ p