summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Albrecht <philipp.albrecht@momox.biz>2021-11-12 16:37:25 +0100
committerPhilipp Albrecht <philipp.albrecht@momox.biz>2021-11-12 16:37:25 +0100
commit437438d2422d8719028a00176a4d914ed92e1fff (patch)
tree331ff9ce174403b386af8e32ee15bf803947745c
parent256900b87a96485d7658ee26df8c96c16559eb0f (diff)
downloadqutebrowser-437438d2422d8719028a00176a4d914ed92e1fff.tar.gz
qutebrowser-437438d2422d8719028a00176a4d914ed92e1fff.zip
Add docstring to _select_backend()
-rw-r--r--tests/conftest.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/conftest.py b/tests/conftest.py
index e1787fc83..ee4572fad 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -226,6 +226,25 @@ def pytest_configure(config):
def _select_backend(config):
+ """Select the backend for running tests.
+
+ The backend is auto-selected in the following manner:
+ 1. Use QtWebKit if available
+ 2. Otherwise use QtWebEngine as a fallback
+
+ Auto-selection is overridden by either passing a backend via
+ `--qute-bdd-backend=<backend>` or setting the environment variable
+ `QUTE_BDD_BACKEND=<backend>`.
+
+ Args:
+ config: pytest config
+
+ Raises:
+ ImportError if the selected backend is not available.
+
+ Returns:
+ The selected backend as a string (e.g. 'webkit').
+ """
backend_arg = config.getoption('--qute-bdd-backend')
backend_env = os.environ.get('QUTE_BDD_BACKEND')