session token fix for captcha
This commit is contained in:
@@ -47,6 +47,30 @@ def pytest_configure(config):
|
||||
config.option.self_contained_html = True
|
||||
|
||||
|
||||
def pytest_collection_modifyitems(config, items):
|
||||
"""Keep the full setup run limited to the shared combined flow."""
|
||||
invocation = " ".join(
|
||||
str(arg).replace("\\", "/") for arg in config.invocation_params.args
|
||||
).lower()
|
||||
full_setup_run = (
|
||||
"tests/setup" in invocation
|
||||
and "tests/setup/sessions" not in invocation
|
||||
and "tests/setup/tokens" not in invocation
|
||||
and "test_session.py" not in invocation
|
||||
and "test_trading_token.py" not in invocation
|
||||
)
|
||||
if not full_setup_run:
|
||||
return
|
||||
|
||||
deselected = [
|
||||
item for item in items
|
||||
if "/tests/setup/sessions/" in f"/{item.nodeid.replace('\\', '/')}"
|
||||
or "/tests/setup/tokens/" in f"/{item.nodeid.replace('\\', '/')}"
|
||||
]
|
||||
items[:] = [item for item in items if item not in deselected]
|
||||
config.hook.pytest_deselected(items=deselected)
|
||||
|
||||
|
||||
# -----------------------------
|
||||
# WebDriver Fixture
|
||||
# -----------------------------
|
||||
|
||||
Reference in New Issue
Block a user