diff --git a/tests/conftest.py b/tests/conftest.py index b8c932ed1..8f2a00c5c 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -90,8 +90,6 @@ def client(request): ) test_ui = request.config.getoption("ui") - if test_ui not in ("", "record", "test"): - raise ValueError("Invalid ui option.") run_ui_tests = not request.node.get_closest_marker("skip_ui") and test_ui client.open() @@ -195,7 +193,7 @@ def pytest_addoption(parser): parser.addoption( "--ui", action="store", - default="", + choices=["test", "record"], help="Enable UI intergration tests: 'record' or 'test'", ) parser.addoption( diff --git a/tests/ui_tests/__init__.py b/tests/ui_tests/__init__.py index 35200a4f3..d4ec43974 100644 --- a/tests/ui_tests/__init__.py +++ b/tests/ui_tests/__init__.py @@ -82,10 +82,8 @@ def screen_recording(client, request): if test_ui == "record": screen_path = screens_test_path / "recorded" - elif test_ui == "test": - screen_path = screens_test_path / "actual" else: - raise ValueError("Invalid 'ui' option.") + screen_path = screens_test_path / "actual" if not screens_test_path.exists(): screens_test_path.mkdir() @@ -98,10 +96,8 @@ def screen_recording(client, request): yield if test_ui == "record": _process_recorded(screen_path, test_name) - elif test_ui == "test": - _process_tested(screens_test_path, test_name) else: - raise ValueError("Invalid 'ui' option.") + _process_tested(screens_test_path, test_name) finally: client.debug.stop_recording()