reflex/tests
Masen Furer 356deb5457
[REF-3589] raise EventHandlerArgMismatch when event handler args don't match spec (#3853)
* test_component: improve valid/invalid event trigger tests

Add test cases for event triggers defined as annotations.

Add additional cases around lambda returning different values.

Improve assertions for invalid tests (each line needs its own `pytest.raises`).

More invalid test cases.

* [REF-3589] raise EventHandlerArgMismatch when event handler args don't match spec

Improve error message for common issue.

Previously when the event handler arguments didn't match the spec, the
traceback resulted in:

```
OSError: could not get source code
```

Now this problem is traceable as a distinct error condition and users are
empowered to debug their code and reference the documentation (to be updated)
for further information.

* raise EventFnArgMismatch when lambda args don't match event trigger spec

Improve error message for another common issue encountered in the reflex framework.

Previous error message was

```
TypeError: index.<locals>.<lambda>() takes 0 positional arguments but 1 was given
```

* Fix up lambda test cases

* call_event_fn: adjust number of args for bound methods
2024-08-29 16:05:15 -07:00
..
compiler use add_imports everywhere (#3448) 2024-06-12 09:26:45 -07:00
components [REF-3589] raise EventHandlerArgMismatch when event handler args don't match spec (#3853) 2024-08-29 16:05:15 -07:00
experimental External assets (#3220) 2024-05-28 09:39:25 -07:00
middleware add module prefix to generated state names (#3214) 2024-07-11 11:13:57 -07:00
states add Bare SQLAlchemy mutation tracking, improve typing (#3628) 2024-07-09 11:13:28 -07:00
utils fully migrate vars into new system (#3743) 2024-08-26 13:28:18 -07:00
__init__.py upgrade to latest ruff (#3497) 2024-06-19 12:32:13 +02:00
conftest.py add Bare SQLAlchemy mutation tracking, improve typing (#3628) 2024-07-09 11:13:28 -07:00
test_app.py fully migrate vars into new system (#3743) 2024-08-26 13:28:18 -07:00
test_attribute_access_type.py Get attribute access type fix (#3803) 2024-08-29 09:45:24 -07:00
test_base.py Rename pynecone to reflex (#1236) 2023-06-25 16:56:55 -07:00
test_config.py Clean up config and app API (#3197) 2024-05-02 18:15:28 -07:00
test_db_config.py Rename pynecone to reflex (#1236) 2023-06-25 16:56:55 -07:00
test_event.py fully migrate vars into new system (#3743) 2024-08-26 13:28:18 -07:00
test_model.py bare sqlalchemy session + tests (#3522) 2024-06-25 15:29:01 +02:00
test_prerequisites.py [REF-2676][REF-2751] Windows Skip ARM devices on bun install + Telemetry (#3212) 2024-05-06 09:50:05 -07:00
test_route.py [REF-2643] Throw Errors for duplicate Routes (#3155) 2024-05-03 12:15:40 -07:00
test_sqlalchemy.py bare sqlalchemy session + tests (#3522) 2024-06-25 15:29:01 +02:00
test_state_tree.py add module prefix to generated state names (#3214) 2024-07-11 11:13:57 -07:00
test_state.py fully migrate vars into new system (#3743) 2024-08-26 13:28:18 -07:00
test_style.py fully migrate vars into new system (#3743) 2024-08-26 13:28:18 -07:00
test_telemetry.py Make .web configurable with REFLEX_WEB_WORKDIR (#3462) 2024-06-17 16:17:00 -04:00
test_testing.py upgrade to latest ruff (#3497) 2024-06-19 12:32:13 +02:00
test_var.py fully migrate vars into new system (#3743) 2024-08-26 13:28:18 -07:00