|
@@ -30,6 +30,7 @@ def pytest_addoption(parser: pytest.Parser) -> None:
|
|
"""Add custom command line options for pytest."""
|
|
"""Add custom command line options for pytest."""
|
|
parser.addoption("--e2e-base-url", action="store", default="/", help="base url for e2e testing")
|
|
parser.addoption("--e2e-base-url", action="store", default="/", help="base url for e2e testing")
|
|
parser.addoption("--e2e-port", action="store", default="5000", help="port for e2e testing")
|
|
parser.addoption("--e2e-port", action="store", default="5000", help="port for e2e testing")
|
|
|
|
+ parser.addoption("--gui-server", action="store", default="flask", help="server for e2e testing")
|
|
|
|
|
|
|
|
|
|
@pytest.fixture(scope="session")
|
|
@pytest.fixture(scope="session")
|
|
@@ -44,6 +45,12 @@ def e2e_port(request: pytest.FixtureRequest) -> str:
|
|
return request.config.getoption("--e2e-port")
|
|
return request.config.getoption("--e2e-port")
|
|
|
|
|
|
|
|
|
|
|
|
+@pytest.fixture(scope="session")
|
|
|
|
+def gui_server(request: pytest.FixtureRequest) -> str:
|
|
|
|
+ """Fixture to get the server for e2e testing."""
|
|
|
|
+ return request.config.getoption("--gui-server")
|
|
|
|
+
|
|
|
|
+
|
|
def remove_subparser(name: str) -> None:
|
|
def remove_subparser(name: str) -> None:
|
|
"""Remove a subparser from argparse."""
|
|
"""Remove a subparser from argparse."""
|
|
_TaipyParser._sub_taipyparsers.pop(name, None)
|
|
_TaipyParser._sub_taipyparsers.pop(name, None)
|
|
@@ -162,6 +169,7 @@ def inject_core_sections() -> t.Callable:
|
|
|
|
|
|
return _inject_core_sections
|
|
return _inject_core_sections
|
|
|
|
|
|
|
|
+
|
|
@pytest.fixture
|
|
@pytest.fixture
|
|
def inject_rest_sections() -> t.Callable:
|
|
def inject_rest_sections() -> t.Callable:
|
|
"""Fixture to inject core sections into the configuration."""
|
|
"""Fixture to inject core sections into the configuration."""
|