|
@@ -3,7 +3,7 @@
|
|
|
import os
|
|
|
import re
|
|
|
from pathlib import Path
|
|
|
-from typing import Generator, Type
|
|
|
+from typing import Type
|
|
|
|
|
|
import pytest
|
|
|
|
|
@@ -81,18 +81,14 @@ def pytest_exception_interact(node, call, report):
|
|
|
)
|
|
|
def app_harness_env(
|
|
|
request: pytest.FixtureRequest,
|
|
|
-) -> Generator[Type[AppHarness], None, None]:
|
|
|
+) -> Type[AppHarness]:
|
|
|
"""Parametrize the AppHarness class to use for the test, either dev or prod.
|
|
|
|
|
|
Args:
|
|
|
request: The pytest fixture request object.
|
|
|
|
|
|
- Yields:
|
|
|
+ Returns:
|
|
|
The AppHarness class to use for the test.
|
|
|
"""
|
|
|
harness: Type[AppHarness] = request.param
|
|
|
- if issubclass(harness, AppHarnessProd):
|
|
|
- EnvironmentVariables.REFLEX_ENV_MODE.set(reflex.constants.Env.PROD)
|
|
|
- yield harness
|
|
|
- if issubclass(harness, AppHarnessProd):
|
|
|
- EnvironmentVariables.REFLEX_ENV_MODE.set(None)
|
|
|
+ return harness
|