MCPcopy
hub / github.com/reflex-dev/reflex / test_multiple_states_error

Function test_multiple_states_error

tests/units/test_app.py:229–243  ·  view source on GitHub ↗

Test that an error is thrown when multiple classes subclass rx.BaseState. Args: monkeypatch: Pytest monkeypatch object. test_state: A test state subclassing rx.BaseState. redundant_test_state: Another test state subclassing rx.BaseState.

(
    monkeypatch: pytest.MonkeyPatch,
    test_state: BaseState,
    redundant_test_state: BaseState,
)

Source from the content-addressed store, hash-verified

227
228
229def test_multiple_states_error(
230 monkeypatch: pytest.MonkeyPatch,
231 test_state: BaseState,
232 redundant_test_state: BaseState,
233):
234 """Test that an error is thrown when multiple classes subclass rx.BaseState.
235
236 Args:
237 monkeypatch: Pytest monkeypatch object.
238 test_state: A test state subclassing rx.BaseState.
239 redundant_test_state: Another test state subclassing rx.BaseState.
240 """
241 monkeypatch.delenv(constants.PYTEST_CURRENT_TEST)
242 with pytest.raises(ValueError):
243 App()
244
245
246def test_add_page_default_route(

Callers

nothing calls this directly

Calls 1

AppClass · 0.90

Tested by

no test coverage detected