reflex/integration
Thomas Brandého 956a526b20
add support for lifespan tasks (#3312)
* add support for lifespan tasks

* allow passing args to lifespan task

* add message to the cancel call

* allow asynccontextmanager as lifespan tasks

* Fix integration.utils.SessionStorage

Previously the SessionStorage util was just looking in localStorage, but the
tests didn't catch it because they were asserting the token was not None,
rather than asserting it was truthy.

Fixed here, because I'm using this structure in the new lifespan test.

* If the lifespan task or context takes "app" parameter, pass the FastAPI instance.

* test_lifespan: end to end test for register_lifespan_task

* In py3.8, Task.cancel takes no args

* test_lifespan: use polling to make the test more robust

Fix CI failure

* Do not allow task_args for better composability

---------

Co-authored-by: Masen Furer <m_github@0x26.net>
2024-05-22 12:07:03 -07:00
..
init-test [REF-2764] dep update 0.5.0 (#3245) 2024-05-07 15:15:52 -07:00
shared fix AppHarness reloading (#2916) 2024-03-26 11:09:46 -07:00
__init__.py Client-side storage / State integration (#1629) 2023-08-30 12:43:29 -07:00
conftest.py fix screenshot filenames (#3241) 2024-05-07 19:31:37 -07:00
test_background_task.py fix AppHarness reloading (#2916) 2024-03-26 11:09:46 -07:00
test_call_script.py ruff-format: unify Black with Ruff v0.1 (#2837) 2024-04-23 14:40:06 -07:00
test_client_storage.py Integration testing: Firefox compatibility (#3162) 2024-04-26 13:44:08 -07:00
test_component_state.py add support for lifespan tasks (#3312) 2024-05-22 12:07:03 -07:00
test_connection_banner.py apps should no longer call "app.compile()" (#2291) 2023-12-18 16:06:21 -08:00
test_dynamic_routes.py ruff-format: unify Black with Ruff v0.1 (#2837) 2024-04-23 14:40:06 -07:00
test_event_actions.py Implement throttle and debounce as event actions (#3091) 2024-04-26 17:28:51 -07:00
test_event_chain.py fix AppHarness reloading (#2916) 2024-03-26 11:09:46 -07:00
test_form_submit.py fix AppHarness reloading (#2916) 2024-03-26 11:09:46 -07:00
test_input.py Integration testing: Firefox compatibility (#3162) 2024-04-26 13:44:08 -07:00
test_large_state.py simple pytest benchmark for measuring event <=> state update round trip time (#2489) 2024-01-30 15:55:55 -08:00
test_lifespan.py add support for lifespan tasks (#3312) 2024-05-22 12:07:03 -07:00
test_login_flow.py fix AppHarness reloading (#2916) 2024-03-26 11:09:46 -07:00
test_media.py fix image serializing - REF-1889 (#2550) 2024-02-22 08:13:19 -08:00
test_navigation.py add support for lifespan tasks (#3312) 2024-05-22 12:07:03 -07:00
test_server_side_event.py fix AppHarness reloading (#2916) 2024-03-26 11:09:46 -07:00
test_shared_state.py fix AppHarness reloading (#2916) 2024-03-26 11:09:46 -07:00
test_state_inheritance.py typed mixins and ComponentState (#3196) 2024-05-15 12:07:41 -07:00
test_table.py ruff-format: unify Black with Ruff v0.1 (#2837) 2024-04-23 14:40:06 -07:00
test_tailwind.py Integration testing: Firefox compatibility (#3162) 2024-04-26 13:44:08 -07:00
test_upload.py Refactor upload component and add styled upload component (#3035) 2024-04-24 13:45:22 -07:00
test_urls.py initial attempt at writing test for urls (#2689) 2024-02-29 13:45:57 -08:00
test_var_operations.py fix AppHarness reloading (#2916) 2024-03-26 11:09:46 -07:00
utils.py add support for lifespan tasks (#3312) 2024-05-22 12:07:03 -07:00